character error fortran 90 - fortran90

I'm struggling with a small program, I can't find how to correct one mistake.
My program:
program calcul
! ce programme permet d'effectuer des opérations mathématique de base
IMPLICIT NONE
REAL::x,y
character(len=1)::op
character(len=16)::op_msg
write(*,*)"entrer le type d'opération à effectuer(+,-,/,x,*)"
read(*,*)op
write(*,*)"entrer le premier nombre de l'opération"
read(*,*)x
write(*,*)"entrer le deuxième nombre de l'opération"
read(*,*)y
if(op=="+") then
write(*,*)x,"plus",y,"egale",x+y
else if(op=="-")then
write(*,*)x,"moin",y,"egale",x-y
else if ((op==("*").or.("x")) then
write(*,*)x,"multiplie par",y,"egale",x*y
else if (op=="/")then
write(*,*)x,"divise par",y,"egale",x/y
else
write(*,*)"erreur:operation incorrecte"
end if
end program calcul
The error message:
calculette.f90:21.26:
else if ((op==("*").or.("x")) then
1
Error: Invalid character in name at (1)
Any idea? I don't understand why "x" is an invalid character?

else if ((op==("*").or.op==("x")) then
You are evaluating two separate conditions, so each one needs a "left" and "right" side.

Related

select multiple checkboses in matlab

I have a gui with nine checkbox in the following code i can select only one of each but what i wanted to add is if the NormeEm checkbox is selected i want to select another checkbox, which i tried to set up at the end of the code by using a switch and 2 cases so that only another one checkbox can be selected but it won't show and it doesn't give me an error code.
function kgexec4n(Init)
%KGEXEC4N boite de dialogue "norme" associée à kgexec4
%CAVIAR2, © ALSTOM + OL 2000/04-2003/03
error(nargchk(0,1,nargin));
persistent blkParamNorm
%%%% ouverture boite
if nargin==1
%"full block path name" du bloc ParamNorme
blkParamNorm=gcb;
if ~strcmp(get_param(blkParamNorm,'MaskType'),'ParamNor')
errordlg(kverranorm(14),'Caviar3','modal')
return
end
%création figure
hf=kgui4n;
%en cas de librairie verrouillée on interdit OK
%x=get_param(get_param(gcs,'Parent'),'Lock'); %modif2.4 10/03/2006
rep=findstr(gcs,'/');
if isempty(rep)
active_sys=gcs;
else
active_sys=gcs(1:rep-1)
end
x=get_param(active_sys,'Lock')
set( findobj(hf,'Tag','NormeOK'), 'Enable', onoff(~onoff(x)) )
else
hf=gcbf;
end
%%%% handles des contrôles et dévalidation de tout
hrb=[findobj(hf,'Tag','Norme0')
findobj(hf,'Tag','Norme1022')
findobj(hf,'Tag','NormeEm')
findobj(hf,'Tag','NormeG53')
findobj(hf,'Tag','NormeCh')
findobj(hf,'Tag','NormeUsrV')
findobj(hf,'Tag','NormeUsrI')
findobj(hf,'Tag','Norme50160')
findobj(hf,'Tag','Norme519')];
hrbVal=get(hrb,'Value');
set(hrb,'Value',0)
hno=[findobj(hf,'Tag','Param0')
findobj(hf,'Tag','Param1022')
findobj(hf,'Tag','ParamEm')
findobj(hf,'Tag','ParamG53')
findobj(hf,'Tag','ParamCh')
findobj(hf,'Tag','ParamUsrV')
findobj(hf,'Tag','ParamUsrI')
findobj(hf,'Tag','Param50160')
findobj(hf,'Tag','Param519-1')
findobj(hf,'Tag','Param519-2')
findobj(hf,'Tag','Param519-3')
findobj(hf,'Tag','Param519-4')];
set(hno,'Enable','off')
%%%% gestion dynamique de la boite
switch get(gcbo,'Tag'); %l'objet ayant provoqué l'appel
%dialogue dynamique
case {'Norme0','Norme1022'}
set(gcbo,'Value',1)
case 'NormeEm'
set(gcbo,'Value',1),enable(hno(3))
switch get(gcbo,'Tag');
case 'Norme1022'
set(findobj(hf,'Tag','Norme1022'),'Value',1)
case 'NormeUsrV'
set(findobj(hf,'Tag','NormeUsrV'),'Value',1),enable(hno(6))
end
case 'NormeG53'
set(gcbo,'Value',1),enable(hno(4))
case 'NormeCh'
set(gcbo,'Value',1),enable(hno(5))
case 'NormeUsrV'
set(gcbo,'Value',1),enable(hno(6))
case 'NormeUsrI'
set(gcbo,'Value',1),enable(hno(7))
case 'Norme50160'
set(gcbo,'Value',1),enable(hno(8))
case {'Norme519','Param519-1'}
set(hrb(9),'Value',1),Scr519(hno(9:12))
end
If i could have some help to figure out what's wrong in my code it would help me a lot

PowerShell space not detected as space in string

I wanna remove all spaces in a string but one space is not detected as a space.
I use ISO 8859-1
$interface[1] is:
Il existe 1 interface sur le système :
I do:
$interface[1].Replace(' ', '')
I get out:
Ilexiste1interfacesurlesystème :
What can I do?

Get parameter of a specific Simulink Block and compare it, Matlab

I'm parsing a text file with matlab which looks like this :
[Date]
2019-03-27 10:45:10.167618
[Component]
Component_Name : Manager principal
Component_ID : _ocl_MEu9Eemg_bhrv2HEbw
{Port}
Port_Name : FOP 1
Port_ID : _sZMXoEu9Eemg_bhrv2HEbw
Port_Type : Outgoing Port
[Component]
Component_Name : Manager 2
Component_ID : _r-HlMEu9Eemg_bhrv2HEbw
{Port}
Port_Name : FIP 1
Port_ID : _sZWIoku9Eemg_bhrv2HEbw
Port_Type : Incoming Port
[Link]
Link_Name : On/Off
Link_ID : _sZfSkku9Eemg_bhrv2HEbw
Link_Source_Name : Manager principal
Link_Source_ID : _ocl_MEu9Eemg_bhrv2HEbw
Link_Source_Port_Name : FOP 1
Link_Source_Port_ID : _sZMXoEu9Eemg_bhrv2HEbw
Link_Target_Name : Manager 2
Link_Target_ID : _r-HlMEu9Eemg_bhrv2HEbw
Link_Target_Port_Name : FIP 1
Link_Target_Port_ID : _sZWIoku9Eemg_bhrv2HEbw
I create a systeme for each [Component] i find and in each systems i create an input or output if the [Component] is a Source or a Target of a [Link].
In my text file example : On/Off is a link between 'Manager principal' and 'Manager 2'. So in the first System (Manager principal) i have an output called On/Off with a specific tag in tag description i set and in the second system (Manager 2) an input called On/Off with a specific tag in the Block tag i set.
So when i launch my code i have 2 system with 1 block in each system.
In this 2 blocks, if it's about the same link (in this example it is) we have this tag :
#_sZMXoEu9Eemg_bhrv2HEbw ==> #_sZWIoku9Eemg_bhrv2HEbw
The ID of the source port ==> the ID of the target port
This is what distinguish a Link than an other.
The context is : if the user change only the name of the Link for example Off/On instead of On/Off it must not create a new block because it's the same Link. So i would like to make a findBlocks() and for each blocks in the current system, i would like to do : if both ID's in tag description are same than in the text file so we just update the name of the block for example .
Here is the code where i create my blocks :
Update : I success to recover C which is the string inside Block tag.
B = find_system(sprintf('%s', component_NameValue));
C = get_param(find_system(sprintf('%s/%s', component_NameValue, link_NameValue)), 'Tag');
if (compareOut == 1) && (compareSource == 1) % Si c'est un port sortant et que c'est le port source du link
add_block('simulink/Ports & Subsystems/In1',[component_NameValue '/' link_NameValue]); % alors on ajoute un block Output de même nom que le link dans le système du composant que l'on parse
linkDescription = sprintf('Link : \n\n%s ==> %s \n\nComposant : \n\nDe : %s (%s) \nVers : %s (%s) \n\nPort Source : \n\n%s \n%s \n\n', link_NameValue , link_IDValue , link_SourceNameValue , link_SourceIDValue, link_TargetNameValue , link_TargetIDValue, link_SourcePortNameValue, link_SourcePortIDValue);
linkTag = sprintf('#%s ==> #%s', link_SourcePortIDValue, link_TargetPortIDValue);
set_param(gcb, 'Tag', linkTag);
set_param(gcb,'Description',linkDescription); % On ajoute une description au block contenant les infos du lien en question contenus dans le fichier texte
end
if (compareIn == 1) && (compareTarget == 1) % Si c'est un port entrant et que c'est le port target du link
add_block('simulink/Ports & Subsystems/Out1',[component_NameValue '/' link_NameValue]); % alors on ajoute un block Input de même nom que le link dans le système du composant que l'on parse
linkDescription = sprintf('Link : \n\n%s ==> %s \n\nComposant : \n\nDe : %s (%s) \nVers : %s (%s) \n\nPort Target : \n\n%s \n#%s', link_NameValue , link_IDValue , link_SourceNameValue , link_SourceIDValue, link_TargetNameValue , link_TargetIDValue,link_TargetPortNameValue, link_TargetPortIDValue);
linkTag = sprintf('#%s ==> #%s', link_SourcePortIDValue, link_TargetPortIDValue); %On ajoute un # devant l'ID du port pour pouvoir le retrouver et voir si un port à été modifié/rajouté/supprimé
set_param(gcb, 'Tag', linkTag);
set_param(gcb,'Description',linkDescription); % On ajoute une description au block contenant les infos du lien en question contenus dans le fichier texte
end
Thanks for helping in advance

ControlGetText get from ClassNN to Number

ClassNN= TDBEditArpa16
I want AutoHotKey to get this value as a number and save it to an integer variable. How can I do this?
Note: I tried to do it through the following code, but the program can not identify it as a number.
ControlGetText, qtp1, TDBEditArpa16, Alteração de Produtos, Informações de Custo
StringTrimRight, qtp1, qtp1, 4
qtp1 = (%qtp1% + 2)
msgbox %qtp1%
Storing the result of an expression:
To assign a result to a variable, use the := operator.
ControlGetText, qtp1, TDBEditArpa16, Alteração de Produtos, Informações de Custo
StringTrimRight, qtp1, qtp1, 4
qtp1 := (qtp1 + 2)
msgbox %qtp1%
Variable names in an expression are not enclosed in percent signs

Data not appearing on node - Neo4j

I have this csv file
Nr_TipoCadeia,Designacao,Descricao
1,Hotel,O hotel � um edif�cio equipado e projectado para albergar as pessoas de forma tempor�ria.
2,Pousada,"As pousadas podem ser uma �tima alternativa aos hot�is, com pre�os mais atrativos e atendimento personalizado."
3,Motel,Motel � um estabelecimento de hospedagem que se diferencia dos demais porque as pessoas geralmente v�o at� ele com o objetivo de manter rela��es sexuais e n�o necess
ariamente para conseguir alojamento.
4,Pensao,"Casa em que se admitem h�spedes, mediante pagamento."
5,Resort," Os resorts possuem servi�os variados de est�tica, quadras poliesportivas e muitas piscinas."
I am trying to import the file to Neo4j using the following query:
load csv with headers from 'file:///TipoCadeia.csv' as line
create (tipocadeia:TipoCadeia {Nr_TipoCadeia: TOINT(line.Nr_TipoCadeia)})
set tipocadeia.Designacao = line.Designacao,
tipocadeia.Descricao = line.Descricao
return tipocadeia;
Everything is ok, except in the node where the third line of the csv file should be stored, it only appears <id>:317 when it should be like
<id>:317 Nr_TipoCadeia:3 Designacao:Motel Descricao:....
The other nodes are fine.
Why is this happening?