bload with string variable

By TheKid

Hero (653)

TheKid's picture

21-04-2018, 16:07

Probably a simple question but I just can't find the correct syntax.

What is the correct way to load a picture ?

10 screen7
20 a$="TEST"
30 bload "" + A$ + ".SC7"+CHR$(34)+",s"
40 goto 40

I have tried several ways in line 30, but I just can't find the correct way. Or I get a file not found or just a hangup.

Login or register to post comments

By mars2000you

Enlighted (5254)

mars2000you's picture

21-04-2018, 16:26

The most simple is to use a second string variable

10 SCREEN 7
20 A$="TEST":B$=A$+".SC7"
30 BLOAD B$,S
40 GOTO 40

Without second variable, it becomes

10 SCREEN 7
20 A$="TEST"
30 BLOAD A$+".SC7",S
40 GOTO 40

By TheKid

Hero (653)

TheKid's picture

21-04-2018, 16:30

Thank you mars2000you, that's the syntax I am looking for Smile You saved my weekend Smile Smile

By eimaster

Master (205)

eimaster's picture

26-04-2018, 15:42

You can add the device from which to BLOAD

To BLOAD from cassette tape:

10 SCREEN 7
20 DV$="CAS:":NM$="TEST":EX$=".SC7":FN$=DV$+NM$+EX$
30 BLOAD FN$,S
40 GOTO 40

To BLOAD from current floppy disk drive (no MSX-DOS2):

10 SCREEN 7
20 DV$="":NM$="TEST":EX$=".SC7":FN$=DV$+NM$+EX$
30 BLOAD FN$,S
40 GOTO 40

BLOAD from floppy disk drive "B:" (MSX-DOS2):

10 SCREEN 7
20 DV$="B:":NM$="TEST":EX$=".SC7":FN$=DV$+NM$+EX$
30 BLOAD FN$,S
40 GOTO 40

I hope I haven't made a mistake or made things worse!

By NYYRIKKI

Enlighted (4924)

NYYRIKKI's picture

26-04-2018, 19:31

eimaster wrote:

I hope I haven't made a mistake or made things worse!

Well, there are quite a few minor errors:
- You can't use ",S" parameter together with cassette device
- You can't use FN$ without using DEF FN first. Use ie. FF$ instead.
- "CAS:" device does not support extensions. (only 6 case sensitive letters with no extension)
- Defining drive letter does not need DOS2 (Only needed if you define path)

My MSX profile