State table variables

User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

State table variables

Post by mark »

Shouldn't be a perm problem. And once the state table is there changing exports shouldn't affect it except to save more or less data.

What's the script/url? What do I have to do to replicate the error?
webinatoruser
Posts: 39
Joined: Fri Apr 08, 2005 8:54 am

State table variables

Post by webinatoruser »

I wouldn't think it was a perm problem but I couldn't think of any other explanation. I also thought it was an internal data structure problem, but if the vortex table is getting dumped, any new schema should take into account the new variables... I think...

the script is:
http://www.trendtrack.com/texis/tt/jerome/new_search

I set "jumpto" as a state table variable yesterday. "q" was the one you managed to get working. I can access "q" now but not "jumpto"
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

State table variables

Post by mark »

The schema of the state table doesn't change.

So what do I do in that script to see the problem behavior you're talking about? What does it do vs. what you expect it to do?
webinatoruser
Posts: 39
Joined: Fri Apr 08, 2005 8:54 am

State table variables

Post by webinatoruser »

Just try a search. The first page of results will have two items that are supposed to be saved to the state table because they can be large. The first is the query the second are the Jump to codes for each state. The Jump to codes are either linked or not, depending on whether there are any results for that state. Since I don't want to run the query for the jump to each time a link is clicked I save the whole thing into the $jumpto variable, tags and all for the first page of records. Does that make sense?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

State table variables

Post by mark »

Doesn't look like jumpto is set before outputting those links. State in table is only stored once with whatever value it has the first time $url is referenced within that run.

You'll need to plan on clearing old entries from that table reqularly so it doesn't get too huge.
nduvnjak
Posts: 40
Joined: Wed Feb 06, 2008 3:45 pm

State table variables

Post by nduvnjak »

"Explain it to me like I'm 6-year-old", lol.

I swear I read the manual several times as well as spent a lot of time searching for this answer in this forum. But I still can't get it to work. Truth is, I am a novice in vortex scripting, but this thing SHOULD be easy... it's a "bread and butter" of any fairly serious website, right?

So here is what I'm trying to accomplish:
pass one variable (it's value) from one script to the next.
Simple enough? And I don't want to do it within query string, or encoded into url, so the answer I'm looking for should be in <EXPORT ... TABLE> I guess.

Here is what I have in script1:

<EXPORT $neededlater TABLE>
...
<$neededlater="Remember This!">
...
<a href="/scripts/texis.exe/script2">Go There</a>
...


Here is what I have in script2:
...
Passed from previous: $neededlater<BR>
...


The value of $neededlater, needless to say, was not preserved. Here is what I tried:
1) to "print" the $url in script1; I put
<capture>$url</capture>
AFTER the $neededlater was set.
2) to include the same <EXPORT> statement at the beginning of script2
3) to "print" $url in script2; I put
<capture>$url</capture>
BEFORE the $neededlater was accessed
4) to do this:
<SQL ROW "select Name, Value from vars">
<setvar $Name $Value>
</SQL>
AFTER "printing" $url and BEFORE accessing $neededlater


What did work:
*NOTHING* :(


Any help will be appreciated, thanks
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

State table variables

Post by mark »

Export only applies to re-invocations of the same script (regardless of entry function). To send data to a different script you need to manually put it in the query string or a cookie. A cookie is most common for data shared across many scripts on one site.
nduvnjak
Posts: 40
Joined: Wed Feb 06, 2008 3:45 pm

State table variables

Post by nduvnjak »

oh, so that's what it was!
thank you, you saved me lot of trouble.
well then, cookies it is.
Post Reply