Announcement

Collapse
No announcement yet.

+= problem with curreny data type

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

  • Gösta H. Lovgren-2
    replied
    Originally posted by Dan G Hoffman View Post
    And it will. Make that UDT nested inside another one as an array like the example above. I
    I ran your code as posted. Didn't bother to post the entire thing as ALL I did was add the "? "here" to show that it ran.

    dont have 9.02 so I cant test it in that. I will wait a bit and if no one can confirm a fix in 9.02 I will email support.
    Dunno anything about a "fix", only that it runs on my machine using 9.02.

    ===================================================
    "A bird that you set free may be caught again,
    but a word that escapes your lips will not return."
    Jewish Proverb
    ===================================================

    Leave a comment:


  • Dan G Hoffman
    replied
    Originally posted by Gösta H. Lovgren-2 View Post
    Compiles fine here:
    ' *******************************************************
    'PBWIN 9.02 - WinApi 05/2008 - XP Pro
    ...
    Type TESTTYPE1
    value As Currency
    End Type
    ...
    ...
    ?"here"
    End Function
    '**********

    It fires the MsgBox:

    ===================================
    "In theory, there is no difference
    between theory and practice.
    But, in practice, there is."
    Jan L.A. van de Snepscheut
    ===================================
    And it will. Make that UDT nested inside another one as an array like the example above. I dont have 9.02 so I cant test it in that. I will wait a bit and if no one can confirm a fix in 9.02 I will email support.

    Leave a comment:


  • Michael Mattias
    replied
    >Compiles fine here:
    >' ************************************************** *****
    >'PBWIN 9.02 - WinApi 05/2008 - XP Pro

    I have not upgraded 9.0.1 to 9.0.2 yet, but 'AS CURRENCY' compiles fine with PB/CC 5.0.2, too; and outside the compiler-specific functions, PB/WIN and PB/CC have always been the same.


    >Apparently the problem was fixed between 9.01 and 9.02.

    Well, you'll have to check the PB/WIN 9.0.2 history.txt file, but the PB/CC 5.0.2 history contains no hits on a search for 'currency.' Of course, that file is missing at least one bug fix I know of.

    Leave a comment:


  • Robert DeBolt
    replied
    Gösta is correct.

    Apparently the problem was fixed between 9.01 and 9.02.
    The same holds for PBCC.

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    Originally posted by Fred Buffington View Post
    Well changing it to Value as CUR allows it to compile so as mcm said, must be a bug.
    Compiles fine here:
    ' *******************************************************
    'PBWIN 9.02 - WinApi 05/2008 - XP Pro
    ...
    Type TESTTYPE1
    value As Currency
    End Type
    ...
    ...
    ?"here"
    End Function
    '**********

    It fires the MsgBox:

    ===================================
    "In theory, there is no difference
    between theory and practice.
    But, in practice, there is."
    Jan L.A. van de Snepscheut
    ===================================
    Last edited by Gösta H. Lovgren-2; 6 Nov 2009, 07:41 PM.

    Leave a comment:


  • Cliff Nichols
    replied
    Cannot access resource compiler results.
    I get this quite often when compiling on a USB drive that is quite full (still not sure if its the swap space to compile, or physical space used to compile but I will bet your problem is that the drive that the code resides on is near full and you are running out of space

    Leave a comment:


  • Fred Buffington
    replied
    Well changing it to Value as CUR allows it to compile so as mcm said, must be a bug.

    **Added Later**
    ... AS CURRENCY compiles here too with 9.02
    Last edited by Fred Buffington; 7 Nov 2009, 07:39 AM.

    Leave a comment:


  • Michael Mattias
    replied
    Ok, I tested it myself with PB/WIN 9.01

    The reason you got a 'can't access resource compiler results" from PBEdit (the IDE) is because PBWIN.EXE (the compiler) GPF'd while compiling this when "value AS CURRENCY" was used. (compiled fine when 'AS LONG' used).

    The technical explanation you seek is, "this is a bug in the compiler and should be reported to [email protected]"

    (Any time the compiler GPFs except for catastrophic hardware failure it's a bug. When you get catastrophic hardware failure? Compiling this program is the least of your worries).

    MCM

    Leave a comment:


  • Michael Mattias
    replied
    shouldn't it be Value as CUR ? Or Value as CUX.
    Well, no; CURRENCY and CURRENCYX are valid. (RTFM).

    Regardless, "Cannot access resource compiler results" is not the correct response when compiling this... unless it used the resource compiler.

    Is this file name "something.RC" ? or do you have whatever this file's extension is in the "extensions" setup in the Options thing as a 'resource file?'

    Let's see what they call that... Window Menu (really, I am not making this up, it's on the Window menu, even though it's a modal dialog and not an MDI window!)...

    ...oops, I digress....

    Ok, where was I... oh, yes..... that's Window Menu, Options, "Editor" tab, "File Types" on the top half of that screen, "RC Source" or "RC Include."

    MCM

    Leave a comment:


  • Fred Buffington
    replied
    shouldn't it be Value as CUR ?
    Or Value as CUX.

    Depending on whether you want 2 or 4 decimal places.
    Last edited by Fred Buffington; 6 Nov 2009, 05:01 PM.

    Leave a comment:


  • Dan G Hoffman
    started a topic += problem with curreny data type

    += problem with curreny data type

    Try to compile this. You get this.
    Cannot access resource compiler results.

    If you change the currency to long it works. Ideas?

    Code:
    #COMPILE EXE
    #DIM ALL
    
    TYPE TESTTYPE1
        value AS CURRENCY
    END TYPE
    
    TYPE TESTTYPE2
        nonArr AS TESTTYPE1
        arr(2) AS TESTTYPE1
    END TYPE
    
    FUNCTION PBMAIN () AS LONG
        DIM tempTest AS TESTTYPE2
    
        tempTest.nonArr.value = 0
        tempTest.arr(1).value = 0
        tempTest.arr(2).value = 0
    
        tempTest.nonArr.value += 1
        tempTest.arr(1).value += 1
        tempTest.arr(2).value += 1
    END FUNCTION
Working...
X