07 March 2018, 23:58 | #1 |
AmigaMan
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
|
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. |
08 March 2018, 01:32 | #2 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
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. |
08 March 2018, 09:50 | #3 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
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. |
09 March 2018, 06:49 | #4 |
AmigaMan
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
|
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! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
view edit bootblocks | locksmith | support.Apps | 2 | 12 November 2016 22:08 |
edit savegame | mcdennem | support.Apps | 3 | 28 December 2009 19:17 |
Can't edit | Galaxy | project.Wiki | 2 | 01 April 2007 23:25 |
Edit quick configurations | intens | request.UAE Wishlist | 3 | 09 March 2007 13:37 |
Edit Workbench Titlebar *Please help* | viddi | request.Apps | 9 | 17 June 2006 11:20 |
|
|