Announcement

Collapse
No announcement yet.

DWORD

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

  • DWORD

    Hi all
    may be I did not look for it very well, but I'm missing something.
    I use number like 100k and more, both in input mode, than using for counting, than show results and change them. I found str_GetD(..) to have the number from a string, *_3232(..) to add subtract etc, . What I miss is to have the string from the number (the opposite of str_GetD()) in order to let the user change it.
    str_Printf(&n, "%ld") would do the job if just it worked with to(..) function

    Is there the needed function? Or how to work around it?

    Thanks
    Alessandro

  • #2
    str_Printf() works for the task.

    eg
    Code:
    func main()
    
        var i, p, strng[20], li[2], str2[20] ;
        to(strng) ;
        print("12345678") ;
        print("As String ", [STR] strng, "\n") ;
        p := str_Ptr(strng) ;
        i := str_GetD(&p, li);
        print("As HEX ", [HEX4] li[0], [HEX4] li[1], "\n") ;
    
        p := str_Ptr(li) ;
        to(str2) ;
        str_Printf(&p, "%ld") ;
        print("As string again ", [STR] str2, "\n") ;
    
        repeat
        forever
    
    endfunc
    Mark

    Comment


    • #3
      Thanks Mark,
      even if it is not reported in the manual, I did tried the to(..) solution but without success.
      Please update the manual reporting that to(..) may be used also with str_Printf and this sample could also be useful

      Alessandro

      Comment


      • #4
        The manual has been updated for the next release.
        Mark

        Comment

        Working...
        X