Shop OBEX P1 Docs P2 Docs Learn Events
Tying data together — Parallax Forums

Tying data together

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2009-05-29 14:44 in Propeller 1
I've got some data coming back from my favorite input routine
in @data and need to send it out with a string statement for my
current project.

The data contains a filename and needs to be passed with a
string that looks like this: string("/folder/folder/")

Naturally I've tried variations of: (string("/folder/folder/",@data)
and: string("/folder/folder")+@data)

Is there an easy way to accomplish this or do I need to do
a bytemove on my @data and add the directory data character
by character, then handle it with string(@data)?

I guess I need to review Jeff Martin's memory management bit
from the webinar clips, but I'm stuck here.

Thanks
OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages @ Warranty Void.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-29 14:28
    PUB catenate(dest,src1,src2) | len1
       len := strsize(src1)
       bytemove(dest,src1,len1)
       bytemove(dest+len1,src2,strsize(src2)+1)
    



    VAR byte buffer[noparse][[/noparse]80]

    catenate(@buffer,string("/folder/folder/"),@data)
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-05-29 14:44
    Thank you Mike!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
Sign In or Register to comment.