19 January 2011, 09:24 | #1 |
Registered User
Join Date: Feb 2010
Location: Australia
Posts: 47
|
arexx help
hi I'm having trouble with my arexx code it runs, but nothing happens here is the listing:
/* my program */ LoopCounter = 0 PlaceValue1 = 0 PlaceValue10 = 0 PlaceValue100 = 0 PlaceValue1000 = 0 do while LoopCounter < 1000 if PlaceValue1 > 9 then PlaceValue1 = 0 PlaceValue10 = PlaceValue10 + 1 end /* end of IF statement */ if PlaceValue10 < 9 then PlaceValue10 = 0 PlaceValue100 = PlaceValue100 + 1 end /* end of IF statement */ if PlaceValue100 < 9 then PlaceValue100= 0 PlaceValue1000 = PlaceValue1000 + 1 end /* end of IF statement */ say "hi!" PlaceValue1000 PlaceValue100 PlaceValue10 PlaceValue1 /* Displays hi! followed by the current value in the PlaceValue Variables */ LoopCounter= LoopCounter +1 end /* end of While statements */ Thanks for any help received Last edited by jimbobrocks92; 19 January 2011 at 09:26. Reason: added thanks |
19 January 2011, 09:50 | #2 | |
Amiga Tomcat
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,502
|
Quote:
Dave G |
|
19 January 2011, 10:19 | #3 |
Registered User
Join Date: Feb 2010
Location: Australia
Posts: 47
|
thx
|
19 January 2011, 11:57 | #4 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,310
|
ARexx has a trace/debug function. Look in your manual about how trace works. This will help and you might easily see what happens (wrong). However, for better readability you should use forums its code tag.
Code:
/* Wonderful magical code follows: */ IF codetagsused=yes THEN DO SAY "Wouhh... that looks good ;-)" EXIT END ELSE SAY "Don`t" Last edited by daxb; 19 January 2011 at 13:53. Reason: bug fixing ;D |
19 January 2011, 12:50 | #5 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,035
|
This is wrong. An IF statement does not have a corresponding end. After THEN and ELSE exactly one statement is executed conditonally. If you want to execute a group of statements, you need to surround them by DO and END. Only DO has a corresponding END. Well, SELECT has one, too. But not IF / THEN / ELSE.
Code:
IF condition THEN one statement else another one statement Code:
IF condition THEN DO multiple statements END ELSE DO other multiple statements END |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AREXX Help | Zetr0 | support.Other | 2 | 26 January 2011 23:09 |
Arexx question | watertonian | Coders. General | 2 | 18 May 2010 22:03 |
ARexx Cookbook | Minuous | request.Other | 14 | 05 November 2009 15:11 |
Arexx | redblade | request.Apps | 2 | 30 August 2006 11:51 |
Arexx | Seti | Coders. General | 2 | 05 August 2003 18:59 |
|
|