Author Topic: Missing variable declaration in .FRM file  (Read 3074 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Missing variable declaration in .FRM file
« 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
 
Frm file Option _Explicit.PNG


I assumed it an INTEGER Type, what is it for?

FellippeHeitor

  • Guest
Re: Missing variable declaration in .FRM file
« Reply #1 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:

 
1.PNG


__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?
« Last Edit: November 13, 2019, 11:46:59 am by FellippeHeitor »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Missing variable declaration in .FRM file
« Reply #2 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.

FellippeHeitor

  • Guest
Re: Missing variable declaration in .FRM file
« Reply #3 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.