how to transform a text in code?

Discussion in 'Questions (Windows Mobile)' started by anjosafado, Sep 30, 2008.

  1. anjosafado

    anjosafado Member

    -----( this application writes the name of the directory that should be done to find)-----------------------

    Table2.AddCol(cString,"Column1",145)
    Table2.Cell("Column1",1) = "AppPath&"&Chr(34)&"\sysdata\"&Chr(34)
    Table2.SaveCSV ("c:\mytable.csv", "," ,False)

    ________________________________

    ------(another application that reads the directory that should be done to find and list the files.)-------------

    Table2.LoadCSV ("c:\mytable.csv", ",", false, true)
    myvaluedir = Table2.Cell ("Column1",1)
    FileSearch ( mylist , myvaluedir , "*.*")
    _______________________________________________


    The problem is that the variable "myvaluedir" is read as text, not in code.
    myvaluedir is : AppPath&"\sysdata\"

    the error message is:-> illegal characters in path in FileSearch

    __________________________________

    if I write manually
    FileSearch ( mylist , AppPath&"\sysdata\" , "*.*")
    at the end it displays correctly
     
  2. klaus

    klaus Expert Licensed User

    You should use

    Table2.Cell("Column1",1) = AppPath&"\sysdata\"

    instead of

    Table2.Cell("Column1",1) = "AppPath&"&Chr(34)&"\sysdata\"&Chr(34)

    Best regards.
     
  3. anjosafado

    anjosafado Member

    Please help me

    the first application this ok , he must write exactly AppPath to know that the other application is to view their own location.
    if I write AppPath&"\sysdata\" he will write the directory location of the first application.
    1 - the first application saves a document with information on which folder the files are. (Local or c: \ xxx)
    2 - The second application is taken to another folder along with the text(CSV)
    3 - the second application is open and read the text(CSV) whether it is to do a search in this folder that he, or in c: \ xxx
    ----------------------------------------------
    the script error in the second application, which does not read the text received with code(script), he gets it right and writing:

    AppPath & "\ sysData \", the more he does not run as code.
    -------------
    how to convert the text AppPath & "\ sysData \" from a text loaded by LoadCSV, in script executed by basic4ppc ?
     
  4. klaus

    klaus Expert Licensed User

    Sorry, I don't really understand the problem you still have.
    So I just made a small example with the code lines of your first post that saves the csv file, reloads it and makes a Filesearch.

    If this is not what you need please can you upload your code so we can see what your problem is.

    Best regards.
     
  5. anjosafado

    anjosafado Member

    already appreciate your effort.

    already appreciate your effort.

    I received the file you sent, plus the only problem is:

    -in file mytable.csv, can not be written -> c:\local\TableFileName\sysData\

    -should be written only-> AppPath &"\sysData\"

    Because I will take your application to another folder with the information already recorded.
    as I explained, will always get the same folder, even if I trasporti to another location.
     
  6. anjosafado

    anjosafado Member

    files...

    Config.exe Is The Application 1
    Atualizar.ex Is The Application 2
    Configatualiza.msc Is The (table Cvs)
     
  7. klaus

    klaus Expert Licensed User

    Here you have 3 possibilities:
    1) the program doesn't save the AppPath and doesn't show it either
    2) the program doesn't save the AppPAth but shows it
    2) you can enter for example "AppPath\system\" and the program tests if the beginning of the text is AppPath it replaces AppPath by it's value otherwise it keeps the cell content.

    Best regards.
     
  8. anjosafado

    anjosafado Member

    Obrigado

    Thank you
    Obrigado
    Gracias
    Merci
    Grazie
    Danke
    Спасибо
    謝謝您
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice