String Conversion

elToritoelTorito Member Posts: 191
edited 2004-07-15 in Navision Attain
Hi,

perhaps a simple question, but i found not useable in the online Help and nor here in the Forum search.

I have a String....

Str := 'My Bicycle. My Car. My House';

What must i do for separate this String on the "." (Point).
Its Possible do it? So that i have:
Str1 := 'My Bicycle';
Str2 := 'My Car';
Str3 := 'My House';

Thanks again for our help :):D
(Oo)=*=(oO)

Comments

  • bruno77bruno77 Member Posts: 62
    Replace the . (point) with , (comma) and then use: SELECTSTR.

    /Bruno
  • RobertMoRobertMo Member Posts: 484
    And if your string originaly also contains commas, then you will have to use functions like STRPOS, COPYSTR, etc.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • elToritoelTorito Member Posts: 191
    hmm. what the largest String that can be ?
    I have Problem that if mein String is a Text Variable with 45 Characters,
    and i read in the ENVIRON Variable

    myString Text 45
    myString := ENVIRON ('TEMP')
    

    I became an error,

    Overflow under type conversion of Text to Text.
    Value: C:\Documen~1\myUser\local...\temp ...

    Can I DO everythin for ommit this error message ?

    Thanks
    (Oo)=*=(oO)
  • RobertMoRobertMo Member Posts: 484
    Define MyString as Text 250 or Text 1024 (depends on version of Navision). Just try it out.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • elToritoelTorito Member Posts: 191
    RobertMo wrote:
    Define MyString as Text 250 or Text 1024 (depends on version of Navision). Just try it out.

    Hmm. i don't know what i did make because any time when i put Text Character over 45 i get error that are too big for the variable, but now it works, i don't must understand it.... :?

    Thanks you.


    EDIT : HMM. Now i have it again the error, :cry:
    "The Length of the Source exceeds the Size of the destination Buffer"

    .
    (Oo)=*=(oO)
  • RobertMoRobertMo Member Posts: 484
    Is it possible that some other variable makes problems ?
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • elToritoelTorito Member Posts: 191
    RobertMo wrote:
    Is it possible that some other variable makes problems ?

    Hmm. i don't know, ... :oops:

    But if i set

    myString Text 50

    I get an error Overflow under typer conversion of Text to Text.
    when i change to:

    myString Text 250

    I get the error:
    The length of source exceed the size of the destination Buffer.

    hmm.
    myString like this:

    myString := '\\path_to_the_server\temppath\filename.ext';

    Thanks.
    (Oo)=*=(oO)
  • i4tosti4tost Member Posts: 208
    I think, that you made a recusion. O you are using while or repeat function to much times??
  • elToritoelTorito Member Posts: 191
    Okay. sorry all. :oops:

    I am experimented with the Multiformat Picture Convertor from Mibuso Download Sections. It seems that i can not pass a large string for the Temp File Create by the Programm. So i think the error don't cames from navison. But Curiosly is that it becames an Navision Error.

    It's to early and it rains again in germany, perhaps i understand this later. :lol:
    (Oo)=*=(oO)
  • fbfb Member Posts: 246
    We were surprised to get the ...source exceed the size of the destination... error message in a project where we were upgrading C/AL code that used Automation from v2.6 to v3.6. In v2.6, the code was working fine. As soon as we tried it in v3.6, we got the error.

    It turned out that there were a number of BSTR parameters being returned from the Automation methods that we didn't care about, so we were storing them in a dummy variable of Text[1]. This worked fine in v2.6. In v3.x however, C/SIDE began complaining about the truncation of the string being returned. When we increased the size of the dummy variable, the error went away.

    It also seems that there is something strange about the length of strings being returned to C/SIDE through the Automation interface. Even though C/SIDE Text variables can now be declared up to 1024 chars, BSTRs being returned from Automation will result in the above error if they exceed 250 characters. (See the following topic for an example: http://www.mibuso.com/forum/viewtopic.php?t=3093 ). Strange.
Sign In or Register to comment.