Weather / Spam / www |
Lyon Weather
aldweb against spam
|
|
|
|
|
|
|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1567 |
Full Version Dim Understanding |
01/08/2007 @ 18:15 by Larry Martin
|
Would anyone tell why I cannot get the following code to compile?
{CREATORID "MyLM"} {VERSION "2.0"}
dim %form1$ dim %prompt1$ dim %max% const %max%=50 CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin dim %numsber%(%max%) dIM %dist%(%max%) end |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 02/08/2007 @ 02:13 by JoeV
visitor |
Hello Larry,
The 2 errors I see are:
- Dim cannot be declared in the program body, only before the begin statement.
- Arrays must be declared as dim A(n) for numbers, or dim A$(n) for strings, where n is an integer, not a variable.
Try something like:
dim A(50) dim A$(50) dim %form1$ dim %prompt1$ dim %max% const %max%=50 CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin
'Program here
end
Regards,
JoeV
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 02/08/2007 @ 20:32 by Larry Martin
visitor |
Joe thanks for the help! But I'm still having problems with one part of the code as I've listed. Do appreciate your help!
' iNew1.ibas {CREATORID "DLML"} {VERSION "2.0"}
dim %form1$ dim %prompt1$ dim %max% const %max%=50 DIM %numsber%(%max%) ' When I add (%max%) I nannot compile CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin print %prompt1$ wait end
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 03/08/2007 @ 02:34 by Larry Martin
visitor |
by Larry Martin 02/08/2007 @ 20:32
Joe thanks for the help! But I'm still having problems with one part of the code as I've listed. Do appreciate your help!
' iNew1.ibas {CREATORID "DLML"} {VERSION "2.0"}
dim %form1$ dim %prompt1$ dim %max% const %max%=50 DIM %numsber%(%max%) ' When I add (%max%) I cannot compile CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin print %prompt1$ wait end
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4 -------- 03/08/2007 @ 03:12 by JoeV
visitor |
Hello Larry,
In IziBasic you cannot create a numerical array named %numsber% of size %max%. Arrays can only be named a or A. So you must replace DIM %numsber%(%max%) with dim a(50). In your program, however, you can retrieve the value a(%max%). Read 'arrays' in the manual. Also, read appendix #9 to understand how IziBasic stores the values.
Hope this helps.
JoeV |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|
|
|
|
|