Announcement

Collapse
No announcement yet.

Couple of questions

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

  • Couple of questions

    I recently upgraded to PB3.5 and am still learning the in's & out's
    of some of the new capabilities. Couple of questions have cropped
    up.

    1. Apparently, 3.5 can flesh out binary strings to (x) places with
    a single function. For example, T$ = BIN$(REG(1)). Well, invariably,
    T$ < 16 places where I need it to be. In 2.1f, I used a Do/Loop to
    flesh it out to 16 places but if 3.5 can handle it internally....

    2. (Too) frequently, when compiling a program, I will get an error
    message on a particular line. Close examination of the line reveals
    no mistakes but looking 2 or 3 lines up, I see a mistake. Correcting
    that mistake causes the compile to proceed????

    How can I make use of question 1 and does anyone have any idea as
    to what's up with question 2?

    Cheers
    Mel


    ------------------
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

  • #2
    Re, question 1: PB/CC and PB/DLL can specify a "digits" argument for padding, but PB/DOS does not. Instead, you can do the padding with RIGHT$.
    Code:
    digits% = 16
    argument% = &HFF
    a$ = RIGHT$(STRING$(digits%,"0")+BIN$(argument%),digits%)
    print a$
    Re, question 2:
    If the program does not have $ERROR ALL ON added to the top, then errors may not get detected at all, or may be detected later in the code, say, at a PRINT statement, etc. Chances are, this is the problem you are seeing.

    However, we have had a confirmed case where the debugger became desynchronized by one or two lines when dealing with source code that represents a PBU file $LINKed into the main file. This may be attributable to a memory manager problem... many of these problems often turn out that way.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment

    Working...
    X