[Scilab-users] linking (jumping) from line of code to an other

Frieder Nikolaisen Frieder.Nikolaisen at student.hs-rm.de
Fri May 12 11:15:35 CEST 2017


 

Hello, 

another question to solve the locomotive stuff, giving you
a example with the not implented code. 

I don't want to code the same
stuff twice. Thats why I want to jump between lines of code. Is this
possible and how? 

P = 200;
DM = 1;

for n = 1:10
 if DM == 1 then 
 if
P > 100 then DM = 1
 P = P - 60
 disp('P bigger 100. DM = ' +
string(DM))
 else DM = 0
 P = P + 100 //instead of writing P = P + 100,
I would like ...
 disp('P smaller 100. DM = ' + string(DM))
 end 
 else
// D == 0 
 if P > 100 then DM = 1 
 disp('P bigger 100. DM = ' +
string(DM))
 P = P - 30
 else DM = 0 // ... to continue here 
 disp('P
smaller 100. DM = ' + string(DM))
 P = P + 100 // to use this P = P +
100
 end
 end 
 disp(string(n) + ' ' + string(P))
end

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170512/2f4ed52c/attachment.htm>


More information about the users mailing list