English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 07 March 2018, 23:58   #1
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
Question 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.
tolkien is offline  
Old 08 March 2018, 01:32   #2
idrougge
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.
idrougge is offline  
Old 08 March 2018, 09:50   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
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.
Daedalus is offline  
Old 09 March 2018, 06:49   #4
tolkien
AmigaMan
 
tolkien's Avatar
 
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!
tolkien is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:25.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09110 seconds with 15 queries