|
Post by Enzo on Jun 19, 2020 23:06:40 GMT
Looked thru all the commands still do not see it does a sub program need to be made to seperate each letter into a word to return from library all together??
|
|
|
Post by Enzo on Jun 19, 2020 23:07:10 GMT
charcter*
|
|
|
Post by B+ on Jun 19, 2020 23:40:49 GMT
Huh? Can you show a before and after of what you are looking for?
|
|
|
Post by honkytonk on Jun 19, 2020 23:41:23 GMT
Except blunder on my part, your title is not related to your message. For the title:
x = 25 'variable x$ = str$(x) 'string x = val(x$) 'return as variable
For the message:
dim b$(len(a$)) 'or: For x = 1 to len (a$) if mid$(a$,x,1) = "" then xx = x-1 ' to count caracters number next x 'dim b$(xx) for x = 1 to xx b$(x) = mid$(a$,x,1) 'to separate letters and put in array$; next x
And:
c$ = "" for x = 1 to xx c$ = c$ + b$(x) 'to reconstruct word next x 'result: c$=a$
|
|
|
Post by Enzo on Jun 19, 2020 23:46:10 GMT
It seems I saw the str$ but it wasnt working on my complier, now I've run into this problem For loadplayers= 1 To player.list playerid=playerid+1 R$ = str$(playerid) 'loadbmp "player";playerid;" ";R$;".bmp"
is not working?
|
|
|
Post by Enzo on Jun 19, 2020 23:47:27 GMT
Also
case instr(id$,"players") player.list = trim$(word$(id$,2,"=")) case instr(id$,"width") map.width = val( trim$(word$(id$,2,"="))) this was working then players shut down for some reason
|
|
|
Post by B+ on Jun 19, 2020 23:51:02 GMT
This might be dumb but it's not going to work with the ' at the start of the line. 'loadbmp "player";playerid;" ";R$;".bmp"
|
|
|
Post by Rod on Jun 20, 2020 8:46:48 GMT
If you click on the ladybug and run the program in the debugger the program will stop on the line causing the error and highlight it. It will also tell you the reason it stopped at the foot of the debugger window or in a dialog box on screen. Show us both when asking for help.
|
|
|
Post by tenochtitlanuk on Jun 20, 2020 9:44:44 GMT
Your syntax is faulty. The following works fine and is what I think you were trying to do.. needs the four bitmaps to run, of course- save them first in the same directory folder as this example! - - - nomainwin
open "Demo" for graphics_nsb as #wg
#wg "trapclose [quit]"
for player =1 to 4 R$ = str$( player) loadbmp "player" +R$, R$ +".bmp" ' we get bitmap '1.bmp' into memory as ''player1', and similarly the others.. #wg "drawbmp player" +R$; " "; player *50; " "; 80 +int( 200 *rnd( 1)) next player
wait
[quit] close #wg end
|
|
|
Post by carlgundel on Jun 20, 2020 13:17:45 GMT
If you click on the ladybug and run the program in the debugger the program will stop on the line causing the error and highlight it. It will also tell you the reason it stopped at the foot of the debugger window or in a dialog box on screen. Show us both when asking for help. Or use the Lite Debug option.
|
|
|
Post by B+ on Jun 20, 2020 15:02:26 GMT
If you click on the ladybug and run the program in the debugger the program will stop on the line causing the error and highlight it. It will also tell you the reason it stopped at the foot of the debugger window or in a dialog box on screen. Show us both when asking for help. Or use the Lite Debug option. Oh hey! There it is under the Run menu, Lite Debug (and spelled nicely too!) I never noticed that before, thanks, I will try myself next time I have a bug, which will be too soon, I'm sure
|
|
|
Post by Rod on Jun 20, 2020 15:41:54 GMT
I prefer full debug where full attention is given and some fantastic debugging tools are on offer. Lite is fine if you know what you are doing, full debug shows more, allows step by step and is imho better for beginners or new to the community. Show globals, show floats execute etc etc.
You need to know all that stuff when you get complicated so the ladybug is your best friend.
Break points, double click the left margin, are a revelation! And something that few folks actually know about!
|
|
|
Post by B+ on Jun 20, 2020 19:32:22 GMT
I prefer full debug where full attention is given and some fantastic debugging tools are on offer. Lite is fine if you know what you are doing, full debug shows more, allows step by step and is imho better for beginners or new to the community. Show globals, show floats execute etc etc. You need to know all that stuff when you get complicated so the ladybug is your best friend. Break points, double click the left margin, are a revelation! And something that few folks actually know about! OK, I barely have used or figured out Ladybug. Thanks Rod Most my debugging involves PRINT variable values at critical points in program or here at JB, I can Notice (but not in a loop! definitely not there!) It works specially well when I am debugging defined Window code, because it prints in mainwin.
|
|