Qbasicnews.com

Full Version: Random tips/suggestions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
1) How about being able to specify a file as an addon to the EXE, that is, data appended to the end of it.

And then being able to open/read/whatever that data with the "regular" commands, perhaps something like

OPEN EXE "AFile_Appended_To_TheEXE.bbbbb" For Input/Binary


Or just something like...
FilePathnName$ = EXCTRACT("AFile_Appended_To_TheEXE.bbbbb")


I dunno.. just an idea... I know it can be easily done by the user himself, just thought it would be nice if it was included from the start, easy to use...




2) Also, PAUSE/BREAK, it would be nice if you could pause the program by pressing PAUSE, just like in QB, I don't know about you guys, but I often use that whien debugging GFX stuff.


3) Hiding a window, among other window manipulations, but this can be done by using windows calls


4) Systray stuff, I know, just thought it would be nice to have built in.


5) Menus... File, Edit, etc etc...



Nothing spciall or needed at all, and most of it can be done using windows or external libs... I just think it would be nice things to have...
yeah prolly,

but i guess doing some wrappers at least for the tasks # > 1 is a more conveniant way then polluting this beatiful compiler with it. keep it small i'd say. everything else can be done by libs, either the direct way or via a wraper. plus anybody could write additions to the runtimelib and send them to v3c. i guess v3c can't do all of this on his own, even with his brazilian chinchilla vodoo powers.
Well, you can add any resource you want to an Windows executable (PE), then it's about using LoadResource() to get a pointer/handle to the raw data you added.

The same applies for menus, dialogs and any GUI component, with a resource editor it becomes simple.
Quote:1) How about being able to specify a file as an addon to the EXE, that is, data appended to the end of it...

Maybe not all of that is needed, but a reliable way to get the full path of the executed EXE at runtime would be helpful in achieving this if one would rather not fool with resource editors. Probably useful for other purposes as well.

Something like a set of functions?

FullEXEName()
ShortEXEName()
FullEXEPath()

Or some sort of generic funtion?

App(1) 'FullEXEName
App(2) 'ShortEXEName
... etc.

I assume there's gonna be no Enum type, but perhaps some predefined constants? Guess we can roll our own, but that leads to lots of code filled with "magic numbers" by lazy programmers.
It got both already ;)

exepath$ returns the executable path (duh) and enum works like in VB:

enum MYENUM
A
B = 2
C
end enum

dim myvar as MYENUM
*feels silly*

What's enum?
Constants, basically. 'myvar' can be assigned any of the MYENUM values.

Code:
enum MYENUM
A
B
C
end enum

dim myvar as MYENUM

myvar = A    // legal
myvar = B    // legal
myvar = D    // *bzzzt* not legal

A,B and C really just correspond to const int values.

If you don't specify values for enum constants, the values start at zero and increase by one with each move down the list.

Above, A has a value of 0, B has a value of 1, and C has a value of 2.

If you want, you can provide explicit values for enum constants, eg

Code:
enum MyEnumType
A = 10
B
C = 1000
end enum
So A = 10, B = 11, C = 1000.

At least, it's like that in C++ anyways..
Quote:Constants, basically. 'myvar' can be assigned any of the MYENUM values...

At least, it's like that in C++ anyways..
Yep, same in VB6, VB.Net etc.

Enums are "enumerated types" and are used to set values for constants in a controlled fashion as well as create a type for variable declaration:
Code:
:
Enum SourceState
  ssGlobalDec = -1 'Start at -1
  ssNull
  ssCode
  ssHTML
End Enum
   :
   :
Dim enuFileState As SourceState
   :
   :
If enuFileState = ssCode Then
   :
In FB it'd be nice to have at least the constant capability if not the full enumerated typing, but if we keep adding feature ideas the thing will never get done.

Forgive the System Hungarian Notation, I know it's out of vogue. I ripped that from an ancient VB 6 program.

Gee, thanks. While I was in there again I found some dead code in that program to pull out! Nothing vital, just a VB6 program I use to process something almost identical to ASP pages into VB6 CGI EXEs. As it happens, it uses the same trick discussed above to append data to the end of a compiled EXE and read it from itself at runtime. The VB6 IDE Resource Editor has some ugly limitations.
Quote:In FB it'd be nice to have at least the constant capability if not the full enumerated typing

It has already Const and Enum or am i missing something?
Quote:It has already Const and Enum or am i missing something?

Sounds like you're way ahead of us. Have I missed a link to some more detailed specs?

No Enums even in VBDOS so I hadn't counted on it in FreeBASIC. Great news.
Pages: 1 2