concatenating strings

Post Reply
wcpriest
Posts: 14
Joined: Sat May 26, 2001 12:59 pm

concatenating strings

Post by wcpriest »

OK. There must be something very obvious that I'm not doing.

I take your example (found searching on concatenates, but not on concatenate :)

<$x = (19 * 6 + 5)>
<$txt = ( "This is test " + $x )>

Then I try to show the results (under NT5):

<SCRIPT LANGUAGE=vortex>
<A NAME=main>
<$x = (19 * 6 + 5)>
<$txt = ( "This is test " + $x )>

X=$x<P>TXT=$txt

</A></SCRIPT>

And both results print as null.

But change (19 * 6 + 5) to "duh"
and $x prints, but $txt is still null.

Does some kind of buffer space need initializing or what to use parenthetical
expressions?

Regards,

Dr. Priest

but the "This is a test duh" doesn't print

And tried this on three different machines, two NT5, one NT4
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

concatenating strings

Post by John »

I just tried your example and it worked. Parenthetical expressions do require a database to be open, and the default database will be opened as you have not specified a database in the script. Most likely the database could not be opened for some reason. How are you running the script? If via a web browser you might want to look at the HTML source to see if there are any error messages.
John Turnbull
Thunderstone Software
wcpriest
Posts: 14
Joined: Sat May 26, 2001 12:59 pm

concatenating strings

Post by wcpriest »

John,

I see.

Yes, it was trying to open this one (below). And yes, if I point it to my f:\texis\db folder,
then parenthetical expressions do work. How very curious.

002 /test3:4: Can't open/create KDBF file c:\morph3\texis\testdb\SYSTABLE.tbl: error 2: No such file or directory
004 /test3:4: Could not create database c:\morph3\texis\testdb

And I don't even have a morph3 directory.

***

Uum. Is there some mysterious reason a database has to be open for parenthetical
expression to work?

This is very obscure :)

You might wish to state this requirement on the only page that mentions concatenation --
just above this example:

<$x = (19 * 6 + 5)>
<$txt = ( "This is test " + $x )>

And, if you do that, then also put the word 'concatenate' on the page so your search
engine finds the page. While I would presume the plus sign was concatenate, when
a test script doesn't work, you doubt the syntax -- first.

Thanks, very much, for the quick answer :) !!

Regards,

Dr. Priest
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

concatenating strings

Post by bart »

The reason a DB must be open is that Vortex and Texis both use a common math functions so that there are not oddities with conversion of data-types etc.

Strings may also be concatenated with the <strfmt> function.
Post Reply