Announcement

Collapse
No announcement yet.

bugs in the Diablo16 Internal Functions Manual

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

  • bugs in the Diablo16 Internal Functions Manual

    I have start a new project using Designer. The first , I have tried to create a button. On page 152, is a function gfx_Button. Well but in example are errors.

    i.e.
    while(touch_Get(TOUCH_STATUS) != TOUCH_PRESS);
    should be right:
    while(touch_Get(TOUCH_STATUS) != TOUCH_PRESSED);

    or

    while(touch_Get(TOUCH_STATUS) != TOUCH_RELEASE);
    should be right:
    while(touch_Get(TOUCH_STATUS) != TOUCH_RELEASED);

    variable state in the example is DOWN or UP, but above in the description is not mentioned, that DOWN or UP can be used instead of values 0 or 1.
    variable font in the example is FONT_4 , well but what is FONT_4, or FONT_1 or where is a description of FONT ID ?



  • #2
    Hello,

    Thank you for pointing this out.
    We will add this on the next update of Diablo16 Internal Functions

    variable font in the example is FONT_4
    You can check the txt_Set function, you will notice the different fonts available for use.

    Again, thank you.

    Best Regards,
    Kevin

    Comment


    • #3
      Hello Kevin,
      thank you. I found it in the meantime.
      Another suggestion for manual update (not found by me yet):
      - the colours.
      i.e. in the command

      gfx_Button(UP, LEFT, TOP, 65500, BLACK, FONT_1 , TEXTWIDTH, TEXTHEIGHT, "C");

      is requested colour. well, the colour like BLACK, GREEN, etc is know, but how about numerical code of colour? I tested that 65500 is like white. In the IDE should be integrated a colour selection ...or does it the numeric code the same like in MS Windows?

      Comment


      • #4
        Hi,

        On your ViSi/Designer program, you will notice the file - "4DGL_16bitColours.inc".
        Hover the mouse on the text and right-click on it. You will see the Colors defined as Constants.

        I hope this helps.

        Best Regards,
        Kevin

        Comment


        • #5
          Hello Kevin,
          please check page 362 at Diablo16 Processor Internal Functions Reference Manual
          in the example is:

          fprint (&p, "%s n" ); // print the result

          What's fprint ? As I remember, FORTRAN know fprint, but here I don't find a reference.

          Comment


          • #6
            Reference Manual, 4D Graphic Language, page 36, example of 7.4. goto:

            Example:
            func main() if(x<20) goto bypass1;
            print("X too small");
            x := 20;
            bypass1:
            if(y<50) goto bypass2;
            print("Y too small");
            y := 50;
            bypass2:
            // more code here
            endfunc


            missing endif

            Too many mistakes in the manuals. Yesterday I have spent full day, more than 12 hours with codes around arrays. I have tried to write values into array, but no much success. Results are different from manual. Later before midnight I have resigned and choose another algorithm, to solve problem with IF-ELSE statement and math solution. It appears, here are also problems.
            Construction:

            if ....
            if ...
            statements
            endif
            else
            if ...
            statements
            endif
            endif


            is working correctly.

            Construction:

            if ....
            if ...
            statements
            endif
            else
            if ...
            statements
            endif
            else
            if ...
            statements
            endif
            else
            if ...
            statements
            endif
            endif


            is non-working.

            Another solution splited into more if - endif giving also problems:

            var K;
            var I;
            var RES;

            if ( K == 14 )
            RES := 0;
            endif

            if ( K == 12 )
            RES := RES * (-1);
            endif

            if ( K < 10 )
            I := I + K;
            endif


            This construction above doesn't work correctly. The first two if-endiff for K==14 and K==12 are omitted.
            Sorry, I need to say, that vintage Hewlett Packard calculator HP9825A from year 1976 wit HPL language have much better firmware. There, at HPL are no problems with arrays and strings and if-else....

            Comment


            • #7
              For the previous post fprint is a typo, you seem to have understood the first fprint is simply a print, the second fprint is str_Printf.

              Our manuals are currently having all examples checked, validated and made more detailed, this will hopefully be released shortly.
              Mark

              Comment


              • #8
                For your most recent post, your comments are very confusing as everything works as expected.

                Code:
                func main()
                    var x, y ;
                    if(x<20) goto bypass1;
                    print("X too small");
                    x := 20;
                bypass1:
                    if(y<50) goto bypass2;
                    print("Y too small");
                    y := 50;
                bypass2:
                // more code here
                endfunc
                Compiles without errors.

                Code:
                func main()
                
                    var K;
                    var I;
                    var RES;
                
                //  K := 14 ;
                //  K := 12 ;
                    K := 8 ;
                    I := 111 ;
                    RES := 999 ;
                
                    if ( K == 14 )
                        RES := 0;
                    endif
                
                    if ( K == 12 )
                        RES := RES * (-1);
                    endif
                
                    if ( K < 10 )
                        I := I + K;
                    endif
                
                    print(K, " ", RES, " ", I) ;
                
                    repeat                      // maybe replace
                    forever                     // this as well
                
                endfunc
                Compiles and words as expected for all cases.

                Have you misunderstood the if/else/endif (multiline) syntax? Basically the else is optional. Thus I would think it is obvious why the first 'construction' is valid and the second isn't.

                As for the array issue, we need some more information so we can assist. Just what on earth did you spend 12 hours on?
                Mark

                Comment


                • #9
                  Mark,
                  thank you very much. I come back to this problem later. I will remove the if-else constructions from my large program and will test various constructions separately.

                  Concerning my problems with strings at 4D GL, that more complicated to explain shortly. I have resigned to use strings now and instead of string I am using a math algorithm with float numbers which resulted in other problems

                  Any way, I come back to strings later and will prepare for you my typical problems. I assume, there is misunderstanding because I am familier with using of strings from HPL ( at HP9825A) and HP Basic at HP9845B and PHP, which appears to be very different from strings and arrays at 4D GL..
                  Last edited by JPL; 20 August 2019, 01:38 AM.

                  Comment

                  Working...
                  X