Shop OBEX P1 Docs P2 Docs Learn Events
A very simple spin question. — Parallax Forums

A very simple spin question.

BTXBTX Posts: 674
edited 2007-09-28 01:01 in Propeller 1
Hi all.
Something is getting me crazy, I will apreciate some help in this.

I've a byte variable which values could be from 1 to 30, and I need to create a string variable with that number plus· the ".btx" string.
In example:

I have a variable·.... nValue := 16
And I need to translate to:·.... ·name := "16.btx"
then I will do .... nValue++
so my new name string will be ... name := "17.btx"

How can I do that ??

It is to put that "name" as the filename, to be open by the Rokicki's SD code.

Thanks in advance !!!


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.

Alberto.

Comments

  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-27 01:20
    did you try using the Numbers object?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-27 01:25
    How about:
    name[noparse][[/noparse] 0 ] := nValue/10+"0"
    name[noparse][[/noparse] 1 ] := nValue//10+"0"
    bytemove(@name+2,string(".btx"),5)
    


    Note that this also copies the zero byte terminator.
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-27 01:59
    ... or
    name[noparse][[/noparse] 0 ] := nValue/10+"0"
    name[noparse][[/noparse] 1 ] := nValue//10+"0"
    
    DAT
     name BYTE "NN.btx",0
    
  • BTXBTX Posts: 674
    edited 2007-09-27 02:14
    Hi !!

    Thanks Ken... I didn't it.

    Thanks Mike and deSilva !! ..... but it seems to be not so easy for me ...unless at this time.. I will try to understand what you·wrote, tomorrow morning....at first sight, it is like "basic chinese" for me smile.gif. Although comming from you..I'm sure that it works !



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-27 02:21
    BTX said...
    ..like "basic chinese" for me
    I believe they call it "simplified Chinese" nowadays.. "basic" is used for English smile.gif
  • BTXBTX Posts: 674
    edited 2007-09-27 11:52
    Hi deSilva.

    Yes, I know that the "correct words"·should be "simplified Chinese"......

    "Basic Chinese" is only a literal expression in my country.... just to mean a too much difficult thing. smile.gif (It sounds more interesting in Spanish..... "Chino básico").

    Same, thanks all for your help !! I will try to decipher what you mean...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-09-27 23:38
    In American english (perhaps British too), the term is "it's all Greek to me", but it conveys same concept.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • BasilBasil Posts: 380
    edited 2007-09-28 01:01
    In Nz its 'huh!?' :P

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page
Sign In or Register to comment.