01 December 2005

Special Tokens

%#!computer@model_num%

which means, look in the Express database for the DS we're connected to, read the computer table, and grab model_num for the machine who's id is %ID%

This is just a number though and it's not necessarily what you want.

If you want to know like, "Latitude D600" or something similar

use

%#!computer@prod_name%

Just be careful, because prod name always has a space in it, and if you're comparing two strings in DOS, like this

SET model=%#!computer@prod_name%

IF "%model%"=="Latitude D600" goto D600

IF "%model%"=="Latitude D610" goto D610

it'll jump to D600 every time, because it only compares the first word before the space. To get around this, I have created a custom view in SQL of the computer table the changes the spaces into _ so then I get "Latitude_D600" back, which works beautifully.

See also Nice forum article

1 comment:

Anonymous said...

Having scoured the internet for this sort of information this was the only useful item I could find. It seems ridiculous to comment on a 3 year old article. But I will anyway in case it helps someone else!
Instead of messing about in SQL views etc you can just alter the output on the fl. Use this custom token instead:

%#*"SELECT UPPER(replace(prod_name,' ','_')) from computer where computer_id=%ID%"%

The UPPER makes sure the output is all one case and the replace removes the space in the output and replaces it with a _.


Cheers

Simon