gemasoft Member Licensed User Longtime User Jun 13, 2014 #1 I have in a service this code: dim a as int dim b as int for a =0 to 10 for b=0 to 10 next b next a And when start the application using this code as service ocurrs an error.- If i change 1 for with DO WHILE, the code is ok.- I can think that this problem is a bug in the compiler? thanks-
I have in a service this code: dim a as int dim b as int for a =0 to 10 for b=0 to 10 next b next a And when start the application using this code as service ocurrs an error.- If i change 1 for with DO WHILE, the code is ok.- I can think that this problem is a bug in the compiler? thanks-
lemonisdead Well-Known Member Licensed User Longtime User Jun 13, 2014 #2 Hello, You can not use the variable's letter in your Next. It should be only Next Code: Copy Dim a as Int ' this could be omitted Dim b as Int ' this could be omitted For a=0 to 10 For b=0 to 10 Log("a: " & a & "/" & "b: " & b) Next Next PS: in your IDE's options, you could check "Test compile when saving". It would have shown the error before you spend the time to try Last edited: Jun 13, 2014 Upvote 0
Hello, You can not use the variable's letter in your Next. It should be only Next Code: Copy Dim a as Int ' this could be omitted Dim b as Int ' this could be omitted For a=0 to 10 For b=0 to 10 Log("a: " & a & "/" & "b: " & b) Next Next PS: in your IDE's options, you could check "Test compile when saving". It would have shown the error before you spend the time to try
LucaMs Expert Licensed User Longtime User Jun 13, 2014 #3 lemonisdead said: Hello, You can not use the variable's letter in your Next. It should be only Next Click to expand... Unfortunately. Upvote 0
lemonisdead said: Hello, You can not use the variable's letter in your Next. It should be only Next Click to expand... Unfortunately.
DonManfred Expert Licensed User Longtime User Jun 14, 2014 #4 LucaMs said: Unfortunately. Click to expand... No. It is like it is described int he documentation. But you can write it like this to help you seeing which for-loop you are in. Code: Copy Dim a as Int ' this could be omitted Dim b as Int ' this could be omitted For a=0 to 10 For b=0 to 10 Log("a: " & a & "/" & "b: " & b) Next ' b Next ' a Last edited: Jun 14, 2014 Upvote 0
LucaMs said: Unfortunately. Click to expand... No. It is like it is described int he documentation. But you can write it like this to help you seeing which for-loop you are in. Code: Copy Dim a as Int ' this could be omitted Dim b as Int ' this could be omitted For a=0 to 10 For b=0 to 10 Log("a: " & a & "/" & "b: " & b) Next ' b Next ' a
LucaMs Expert Licensed User Longtime User Jun 14, 2014 #5 DonManfred said: No. It is like it is described int he documentation. But you can write it like this to help you seeing which for-loop you are in. Code: Copy Dim a as Int ' this could be omitted Dim b as Int ' this could be omitted For a=0 to 10 For b=0 to 10 Log("a: " & a & "/" & "b: " & b) Next ' b Next ' a Click to expand... Thanks Manfred. I can also write a more descriptive string (Next ' c - customer) but an automatic insertion would be useful: I write: For A = ... and pressing Enter Next A (case sensitive too) Upvote 0
DonManfred said: No. It is like it is described int he documentation. But you can write it like this to help you seeing which for-loop you are in. Code: Copy Dim a as Int ' this could be omitted Dim b as Int ' this could be omitted For a=0 to 10 For b=0 to 10 Log("a: " & a & "/" & "b: " & b) Next ' b Next ' a Click to expand... Thanks Manfred. I can also write a more descriptive string (Next ' c - customer) but an automatic insertion would be useful: I write: For A = ... and pressing Enter Next A (case sensitive too)
DonManfred Expert Licensed User Longtime User Jun 14, 2014 #6 LucaMs said: Thanks Manfred. I can also write a more descriptive string (Next ' c - customer) but an automatic insertion would be useful: I write: For A = ... and pressing Enter Next A (case sensitive too) Click to expand... Yes, that would be great Upvote 0
LucaMs said: Thanks Manfred. I can also write a more descriptive string (Next ' c - customer) but an automatic insertion would be useful: I write: For A = ... and pressing Enter Next A (case sensitive too) Click to expand... Yes, that would be great