Announcement

Collapse
No announcement yet.

Whislist for all compilers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Whislist for all compilers

    Hi Tom,

    I think that it's interesting for all the compilers:

    Build-in the keywords:
    - #define
    - #uses FP8087

    Pre-initialization en declaration all types of variables:
    Examples:

    DIM a AS Counter = 5
    DIM a(0 TO 4) AS BYTE = (45,78,9,25,65)

    - Build-in the Enumeration Datatype like this

    TYPE Values AS ENUM = (Good, Middle, Bad)

    - Build-in datatypes:

    * DATE
    * BIT

    Greetings,
    Stephane



    ------------------

  • #2
    No OO spiel?? I'm impressed!

    I'd like to vote for them!

    Define wchar as Word

    Dim UnicodeStr(50) as wchar

    uses 686

    Bit flags exist, Bit type is not really needed, PB is pretty good with bits, a lot better than VB

    Date type! how are people doing this???? eg, PB was supposed to just be a DLL compiler for VB once upon a time, what do you do if VB passes you a date type? a double counted in seconds since 1899 Jan 1 or something.
    That'd be nice.

    I like enums too but constants are that much different



    ------------------

    Paul Dwyer
    Network Engineer
    Aussie in Tokyo
    (Paul282 at VB-World)

    Comment


    • #3
      Stephane --

      > #define

      You'd rather type "#define" than "%"? Ok, it might be nice to be able to #INCLUDE files that contain #define lines but that opens up a whole can of worms, because of the other things those files usually contain. The compiler would have to understand the rest of the syntax too. (BTW I posted a short program on the Source Code forum that converts H files with #define to equate files that PB can digest. It ignores everything except #define lines.)

      > #uses FP8087

      WHY?

      > DIM a AS Counter = 5

      As opposed to...

      DIM a AS Counter
      Counter = 5

      It might save you a little typing, but that would be it. Plus... It could only work with LOCAL variables, so you could not use it to initialize GLOBAL values.

      > DIM a(0 TO 4) AS BYTE = (45,78,9,25,65)

      On the surface that looks like a good suggestion, but how would you initialize arrays with
      more than one dimension?

      DIM a(0 TO 4, 1 TO 2) AS BYTE = ((45,1),(78,13),(10,48)... YUCK!

      Paul --

      > Date type! how are people doing this?

      I don't use VB, but PB/DLL and PB/CC both support data types that can be used for the two "major" Windows date formats. The QUAD data type makes a fantastic date-type when you use it in place of the Windows FILETIME structure. It's an integer data type, so there are no rounding errors. It has 10-nanosecond (theoretical) resolution, and a range of thousands of centuries. And since it is "linear", date math is very, very easy.

      The SYSTEMTIME structure is also available. The resolution is 1 millisecond, and it is limited to a much smaller (but usually adequate) range of dates.

      The Windows API supports both of those date-types "natively", and several different manipulation/conversion functions are available.

      IMO the VB DATE type is much more limited than either of those! The time is represented as the fractional part of a floating point number, so rounding problems become a nightmare!

      If PowerBASIC ever adds a DATE data type, I hope they don't limit themselves to VB's nonstandard, limited version of a "date/time". I'd much rather see them use a native Windows date-type, and provide functions to convert to/from a VB date.

      -- Eric


      ------------------
      Perfect Sync: Perfect Sync Development Tools
      Email: mailto:[email protected][email protected]</A>
      "Not my circus, not my monkeys."

      Comment


      • #4

        > #uses FP8087

        WHY?

        I would like to be able to optimise compilation for different processor sets, just 486, pentium & pro would be a good start, we can select version3,4,5 why not processor?.

        Thanks for the Date info, I'm not really fussed about date systems, VB or whatever, just previded they have some good date types and functions for math.


        What about
        Dim a As Integer: a = 5 'not much longer and still one line

        ------------------

        Paul Dwyer
        Network Engineer
        Aussie in Tokyo
        (Paul282 at VB-World)

        Comment


        • #5
          Paul,
          it could be usefull to have some switches for processor optimization, but
          all currently available CPU's have a floating point unit so the fpx
          switch is useless. What do you want to do if the switch is set to off??
          Use a simulation like in the old dos (compiler) days??

          ----------------
          Peter Patzwaldt

          ------------------

          Comment


          • #6
            > DIM a(0 TO 4) AS BYTE = (45,78,9,25,65)
            On the surface that looks like a good suggestion, but how would you initialize arrays with
            more than one dimension?
            DIM a(0 TO 4, 1 TO 2) AS BYTE = ((45,1),(78,13),(10,48)... YUCK!


            Well, that's how Pascal does it... just because you find the resulting syntax annoying doesn't change the fact that it would be a potentually useful feature. If you have an idea on how to do it better, though, then by all means share it with us.

            ------------------

            Comment


            • #7
              > just because you find the resulting
              > syntax annoying doesn't change the fact

              True. Snide comment withdrawn.

              There are lots of existing ways to initialize the elements of an array to predefined values. Direct assignment, DATA statements, etc. My personal preference is to create a disk file that contains an image of the array containing the predefined values. My FileToString function gets the string-image for me, and then I POKE$ the string at the location of the first array element. Works for all numeric types and all TYPEs. The same thing can be done by embedding the image in a resource file.

              -- Eric

              ------------------
              Perfect Sync: Perfect Sync Development Tools
              Email: mailto:[email protected][email protected]</A>



              [This message has been edited by Eric Pearson (edited February 05, 2001).]
              "Not my circus, not my monkeys."

              Comment


              • #8
                Perhaps, but

                Direct assignment, DATA statements

                involve a lot of wasted code or data space, especially when you're talking about initializing a half-dozen lookup tables of 486 elements apiece, and the embedded-resource suggestion only works if you're using the Windows-based compilers. (And, for that matter, only if you know how to use the resource compiler - which I don't, really, since I bought my copy of PB/DLL as a standalone environment, not as an adjunct to VB, and don't have any of the VB docs.)

                As for the external-data files... well, yeah, but I just like to have everything contained within a single .EXE file if I can, rather than relying on a bunch of external files. Personal preference, I guess.

                ------------------

                Comment


                • #9
                  Gary --

                  You don't need VB to use resource files. The Microsoft Resource Compiler (RC.EXE) is standard equipment with the PB/DLL compiler. Check out the BIN directory for the compiler and the help file. There's a basic Resource Editor provided, too.

                  It allows you to embed virtually anything you want in an EXE or DLL... icons, sounds, bitmaps, strings, binary array images... anything you want. You can even embed entire program modules if you want to. Get the binary string from the resource, save it to a file with an EXE extension, and SHELL to it. (I'm not saying that that's especially useful, just that you can embed anything.)

                  > Personal preference, I guess.

                  I guess we both have our personal likes and dislikes.

                  -- Eric

                  ------------------
                  Perfect Sync: Perfect Sync Development Tools
                  Email: mailto:[email protected][email protected]</A>



                  [This message has been edited by Eric Pearson (edited February 05, 2001).]
                  "Not my circus, not my monkeys."

                  Comment


                  • #10

                    paul & eric,

                    i thought i remembered seeing a post a by dave navarro regarding
                    vb dates in pb. it can be found at:


                    thanks



                    ------------------
                    paul squires
                    [email protected]
                    Paul Squires
                    FireFly Visual Designer (for PowerBASIC Windows 10+)
                    Version 3 now available.
                    http://www.planetsquires.com

                    Comment


                    • #11
                      >DIM a AS Counter = 5
                      >As opposed to...
                      >DIM a AS Counter
                      >Counter = 5

                      The current VB code causes the variable 'a' to be assigned twice.
                      Once when allocated (assigned a value of Zero)and once when a value is assigned. The
                      new way will initialize the value to what the programmer wants. More efficient!




                      ------------------
                      Ron

                      Comment


                      • #12
                        I think #use will be ESPECIALLY usefull when PB adds in commands
                        to support DirectX, 3D-Now, SSE, and SSE2!



                        ------------------
                        Thanks,

                        John Kovacich
                        Thanks,

                        John Kovacich
                        Ivory Tower Software

                        Comment


                        • #13
                          You don't need VB to use resource files. The Microsoft Resource Compiler (RC.EXE) is standard equipment with the PB/DLL compiler. Check out the BIN directory for the compiler and the help file. There's a basic Resource Editor provided, too.

                          Oh, I know... but the help file is, IMO, singularly un-helpful if you don't already have some idea of what you're doing. If there hadn't been a couple of PB sample programs that did it, I'd never have figured out, just from the RC help file and the PB docs, how to put my own icon in the title bar...

                          Also, as referenced previously, the array-as-a-resource idea only works if you're using the Windows compilers. The program which uses the half-dozen large lookup tables, and which prompted me to consider the preinitialized array suggestion a desirable one, is a DOS program targeted to an embedded system.

                          ------------------

                          Comment

                          Working...
                          X