Announcement

Collapse
No announcement yet.

Resourcequestion - value as string

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

  • Edwin Knoppert
    replied
    Oh boy, you really thought..?

    Leave a comment:


  • Michael Mattias
    replied
    >I am using RCDATA a lot, so handy

    Gee, no kidding. Nice to know someone finally got some use out of that that demo I posted almost SIX YEARS AGO. All in all, kind of inspiring. Gives me that warm and fuzzy feeling I crave from time to time.

    User-Defined Resource Demo January 26 2003

    Leave a comment:


  • Edwin Knoppert
    replied
    I would need to write me a new system then.
    The above works for me fine, i am using defines and looks good.

    Your code does work as well, the L makes it a dword and is interesting for prefilling structures for example..
    I am using RCDATA a lot, so handy.

    Leave a comment:


  • Michael Mattias
    replied
    Why not just store the OR'd flags as an integer in the resource?
    Code:
    #define flags  1L|2L|8L
    TEST  RCDATA
    begin
        flags
    end
    Something like that, anyway.

    For all I know this might work...
    Code:
    TEST RCDATA
    BEGIN
        1L | 2L | 8L 
    END
    ... but that I've never tried.

    MCM

    Leave a comment:


  • Edwin Knoppert
    replied
    ..
    Last edited by Edwin Knoppert; 13 Dec 2008, 05:39 AM.

    Leave a comment:


  • Edwin Knoppert
    replied
    Sigh.. must had a clear mind today, found it myself (PwrDev code):

    Code:
    TEST RCDATA
    {    
         100L,  "1|2|8"
                "\0"
    }
    Code:
    Function Test() As Long
    
        Local T As String
        Local a As Long
        Local dwFlags As Dword
    
        T = VD_RES_LoadDataString( VD_App.hInstance, "TEST", 100 )
    
        For a = 1 To ParseCount( T, "|" )
            dwFlags = dwFlags Or Val( Parse$( T,"|", a ) )
        Next
    
        MsgBox Format$( dwFlags )
    
    End Function

    Leave a comment:


  • Edwin Knoppert
    started a topic Resourcequestion - value as string

    Resourcequestion - value as string

    I wrote a 'system' where i can obtain a string from a RCDATA using indexes like:

    100L, "HELLO\0"
    101L, "HELLO TOO\0"

    The hello part is used to store flags as well (not shown).
    I just wonder how i can do something like this:

    100L, "1 or 2 or 8"
    Of course, this remains text, i need the or'd flag but in readable text.
    It should be "11"

    I don't think it is possible but would like to try.
Working...
X