English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Blitz Basic (https://eab.abime.net/forumdisplay.php?f=126)
-   -   Edit$ problems (https://eab.abime.net/showthread.php?t=91135)

tolkien 07 March 2018 23:58

Edit$ problems
 
Hiz mates.
Im doing an small thing in blitz (amiblitz 2) again but I have a problem with Edit$.

I have a statement to read some data from a file that starts like this:

Code:

Statement Load_Map{}
  SHARED matriz()
  pos.l = 0
  Use BitMap #SPRITESbm
  BitMapOutput #SPRITESbm
  FileName$ = Edit$(100)
  QAMIGA
  If ReadFile(0,FileName$)
    FileInput 0
    something......

    CloseFile 0
     
      more things...
      Blitz : Bitmapinput
  End If
End  Statement


The firt time I use this It works well but the second time It gives me an "Invalid Inpuit File" in FileName$ = Edit$(100) line.

Im crazy with it! Any idea mates? Thanks.

idrougge 08 March 2018 01:32

I think it might be because you have a BLITZ directive in the middle of an if clause.

BLITZ, AMIGA and QAMIGA change the entire behaviour of the compiler, going downwards from when they're used. They're not commands or statements in the normal sense.

Daedalus 08 March 2018 09:50

I think the issue is that you've redirected the input stream from the file the first time, but not set it back to what it was afterwards. Therefore when you get to the Edit$() again, it's trying to read from the first file, but you've since closed the file so it doesn't have anywhere to get its input from. Try putting the BitmapInput statement just before the Edit$() function and see if that helps.

As idrougge says, switching modes does some "interesting" things, so you might also try having the BitmapOutput on the Amiga side, since it was in the Amiga mode that the input stream was switched away. Finally, perhaps you need a Blitzkeys On statement after you return to Blitz mode, just in case that was cancelled by leaving the mode.

tolkien 09 March 2018 06:49

I have been trying different things without success so I have re coded it from start and seems it goes better.
Thanks for the help mates!


All times are GMT +2. The time now is 21:42.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04376 seconds with 11 queries