QB64.org Forum

QB64 Team Software => InForm Discussion => Topic started by: bplus on November 13, 2019, 10:41:43 am

Title: Missing variable declaration in .FRM file
Post by: bplus on November 13, 2019, 10:41:43 am
Hi Fellippe,

Using OPTION _EXPLICIT when developing Text Fetch, I ran into a new variable in FRM file not being DIM'd
  [ This attachment cannot be displayed inline in 'Print Page' view ]  

I assumed it an INTEGER Type, what is it for?
Title: Re: Missing variable declaration in .FRM file
Post by: FellippeHeitor on November 13, 2019, 11:18:02 am
That's interesting. __UI_RegisterResult will be automatically declared when saving a form if any control has been assigned with a key combo or if you have an animated gif in the form. This is how the automatic declaration looks:

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

__UI_RegisterResult will be True if the last key combo assignment or gif loading operation were successful.

I see in your screenshot what looks like a manual __UI_RegisterResult  = 0, was that something else that you edited?
Title: Re: Missing variable declaration in .FRM file
Post by: bplus on November 13, 2019, 11:50:14 am
So it was supposed to be a LONG Type.

Yeah, I edited the frm file many times in a building process as I completely lost my first Frm save by trying to create a folder and save the frm in it at same time and I got some ...FRM and ...BAS crud somewhere along the line, so I started a building process, testing with bas code in file, adding on until I had what I wanted. Somewhere on that way I added OPTION _EXPLICIT and it immediately pointed to the variable not DIM'd in FRM file that stopped my progress until that was addressed, so I put that DIM's variable in from IDE edit of BAS

It would be nice to be able to make a directory to save a project into but the IDE is same way, I should know by now.

I have to say, it is not my way of programming to get the FRM right on the first go or even the 6th.
Title: Re: Missing variable declaration in .FRM file
Post by: FellippeHeitor on November 14, 2019, 12:47:26 am
I've done some more local tests and I apologize, bplus: It was I who added __UI_RegisterResult  = 0 all along, forgetting to declare it. That extra "reset" of the variable shouldn't be added as often as it is being added now, so I thank you for letting me know. I'll get it fixed for the next version.