Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug Reports
If it only single line, it's what you got to take. But if it has a few more lines, the "\" will win the heart of the coders. Big Grin

Since you mentioned DEF###, I never understand how they use that in QB. I was use RQ before it was much more better example to follow for DEFxxx:

[syntax="qbasic"]
DEFINT i,j,k,num=100 ' equ in C: int i,j,k, num=100
DEFSNG X-Axis = 0.346757
DEFBYTE somearray(10) = {0,1,2,3,4,5,6,7,8,9}
DEFSTR sex$(1 to 2) = {"Male","Female"}
[/syntax]

this is save some coding time and speed-up variables declarations. it run like magic if this can be implement in FB.
= inc(¢) Big Grin
Reply
Well, it isn't really. Doing "asdf" + quot$ + "asdf" is really annoying and it impedes readability

I'm for an escape keyword or function:

' replace "escape" with "literal" for reverse
mystring$ = ESCAPE "hi \n bye"
mystring$ = LITERAL "hi \n bye"

or a character like suggested:

mystring$ = e"hi \n bye"
mystring$ = l"hi \n bye"

and then add a metacommand to turn it on by default.

'$defesc on
mystring$ = "hi \n bye"
Reply
Ugh this is getting very messy. Sad
I'd knock on wood, but my desk is particle board.
Reply
How about: mystring$ = ESCAPE "hi \"" + user$ + ESCAPE "\""

Or: mypath$ = LITERAL "c:\" + filepath$ + LITERAL "\" + filename$

Readable? Don't think so. ESCAPE|LITERAL couldn't "live" for each expression operand, it would have to be added before every literal string..

'$'s are bad, remember, surround it with real comments and it will take ages to be found.. OPTION ESCAPE is more clear.. as OPTION DYNAMIC | STATIC would, instead of that ugly '$dynamic|static thing.

How about this, leave quotes on '$include but don't process any escape chars inside it, as happens with aposts.. more consistence and i doubt anyone would use escape chars to define an include file..
Reply
Victor,
are you changing this:

'$include

to that:

#include

?

Because somehow it doesn't make sense to me having:

#DEFINE
#IFNDEF
#ENDIF

but

'$include

All are compiler directives/switches or not?
If so they should use the same prefix :wink:
Reply
Okay, that makes sense.

Hrm... Maybe just a function then:
escape("asdjfkl")
literal("asdfjkl;")

and have the metacommand for setting defaults? I guess you could do option escape, but "$" makes more sense as something you're telling the compiler to do, and not the program.. You can hide anything in bad code.

fsw: I'm probably wrong, but I think "#" is a preprocessor command and "$" is a metacommand, from qb.
Reply
# imo is preprocessor, C like thingy
'$ is QB like, and tells the compiler what to do, stuff like: '$Dynamic

#Dynamic

Not QB...

but meh
just make sure to make a standard soon, so we don't have to change our FB sourcecode for each new release of FBC...
Reply
The last time I worked with QB was 1989.
Never worked with VB :barf:
Only with other Basic dialects and C.

The preprocessor is build in the compiler, is it not?
If you look at the compiler like a black box, it's unimportant how many preprocessors are build in the compiler, or if it's a 1 pass or 2 pass compiler.

Also I don't care how much I have to adapt to a certain programming language syntax.
Once I got the syntax digested I like to keep it simple, consitent, resonable and reliable.
For me consitency is the key.

So yes, a standard would be nice.
Reply
I kinda like the idea of having a function to process escape characters. And without that function, all text in a string is just what it is. (the escape character is on my list of why-I-hate-C)
Reply
As a perl affectionado, I love the escape character. Actually, I would be in support of some kind of regex parsing, but that would take some insane work, I imagine, you might as well throw in DRAW while you're there.

As far as preprocessing goes, That doesn't matter so much. Just make some kind of clear functional definition between preprocessing and compiler options. I can sort of see the difference between conditional compiling and say, $dynamic, but I can't really put it to words.

I still support a metacommand for escape characters over OPTION. I'd get rid of OPTION altogether if I could, or metacharacters. They can't work together, they're bitter enemies of nonunity.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)