Indigo Rose Software
  #1  
Old 10-04-2004
brianlesker brianlesker is offline
Forum Member
 
Join Date: Oct 2003
Posts: 49
Get variabele from a Table

I'm back again, everyone got a good weekend?

I have the following problem, i have a text file, with 2 lines.
Want to get line 2 and put this value in a variabele, can someone tell me how to do that?


Tried:
Code:
tableDatabaseSize = TextFile.ReadToTable(strAppSqlDir.."\\TablespaceSize.txt");
Howto publish a table cq a specifiek var.
Reply With Quote
  #2  
Old 10-04-2004
JXBURNS's Avatar
JXBURNS JXBURNS is offline
Forum Member
 
Join Date: Apr 2001
Location: Haverhill, Suffolk, UK
Posts: 333
result = tableDatabaseSize[2];

should do it I would think.

John
Reply With Quote
  #3  
Old 10-04-2004
brianlesker brianlesker is offline
Forum Member
 
Join Date: Oct 2003
Posts: 49
That is what i needed.

Merci!
Reply With Quote
  #4  
Old 10-04-2004
brianlesker brianlesker is offline
Forum Member
 
Join Date: Oct 2003
Posts: 49
do i miss multiply (* or x ) in math functions?
Reply With Quote
  #5  
Old 10-04-2004
Ted Sullivan's Avatar
Ted Sullivan Ted Sullivan is offline
Indigo Rose Staff Member
 
Join Date: Oct 2003
Posts: 825
The Setup Factory 7.0 scripting engine fully supports mathematical expressions and operators. Here is a section of the Scripting Guide that covers it. Note that there are also many mathematical functions as well. They are part of the Math actions included with Setup Factory 7.0.

Expressions and Operators
An expression is anything that evaluates to a value. This can include a single value such as “6” or a compound value built with operators such as “1 + 3”. You can use parentheses to “group” expressions and control the order in which they are evaluated. For example, the following lines will all evaluate to the same value:

Code:
a = 10;
a = (5 * 1) * 2;
a = 100 / 10;
a = 100 / (2 * 5);
Arithmetic Operators
Arithmetic operators are used to perform mathematical operations on numbers. The following mathematical operators are supported:

Code:
+            (addition)
-             (subtraction)
*             (multiplication)
/             (division)
unary -    (negation)

Here are some examples:

a = 5 + 2;
b = a * 100;
twentythreepercent = 23 / 100;
neg = -29;
pos = -neg;
Relational Operators
Relational operators allow you to compare how one value relates to another. The following relational operators are supported:

Code:
>            (greater-than)
<            (less-than)
<=          (less-than or equal to)
>=          (greater than or equal to)
~=          (not equal to)
==          (equal)
All of the relational operators can be applied to any two numbers or any two strings. All other values can only use the == operator to see if they are equal.

Relational operators return Boolean values (true or false). For example:
Code:
10 > 20; -- resolves to false

a = 10;
a > 300; -- false

(3 * 200) > 500; -- true
"Brett" ~= "Lorne" -- true
One important point to mention is that the == and ~= operators test for complete equality, which means that any string comparisons done with those operators are case sensitive. For example:

"Jojoba" == "Jojoba"; -- true
"Wildcat" == "wildcat"; -- false
"I like it a lot" == "I like it a LOT"; -- false

"happy" ~= "HaPPy"; -- true

Logical Operators
Logical operators are used to perform Boolean operations on Boolean values. The following logical operators are supported:
Code:
and         (only true if both values are true)
or           (true if either value is true)
not          (returns the opposite of the value)

For example:

a = true;
b = false;
c = a and b; -- false
d = a and nil; -- false
e = not b; -- true
Note that only nil and false are considered to be false, and all other values are true. For example:
Code:
iaminvisible = nil;
if iaminvisible then 
     -- any lines in here won't happen
     -- because iaminvisible is considered false
     Dialog.Message("You can't see me!", "I am invisible!!!!");
end

if "Brett" then
     -- any lines in here WILL happen, because only nil and false
     -- are considered false...anything else, including strings,
     -- is considered true
     Dialog.Message("What about strings?", "Strings are true.");
end
Concatenation
In Setup Factory scripting, the concatenation operator is two periods (..). It is used to combine two or more strings together. You don’t have to put spaces before and after the periods, but you can if you want to.

For example:
Code:
name = "Joe".." Blow"; -- assigns "Joe Blow" to name
b = name .. " is number " .. 1; -- assigns "Joe Blow is number 1" to b
Operator Precedence
Operators are said to have precedence, which is a way of describing the rules that determine which operations in a series of expressions get performed first. A simple example would be the expression 1 + 2 * 3. The multiply (*) operator has higher precedence than the add (+) operator, so this expression is equivalent to 1 + (2 * 3). In other words, the expression 2 * 3 is performed first, and then 1 + 6 is performed, resulting in the final value 7.

You can override the natural order of precedence by using parentheses. For instance, the expression (1 + 2) * 3 resolves to 9. The parentheses make the whole sub-expression “1 + 2” the left value of the multiply (*) operator. Essentially, the sub-expression 1 + 2 is evaluated first, and the result is then used in the expression 3 * 3.

Operator precedence follows the following order, from lowest to highest priority:
Code:
and         or
<     >   <=   >=   ~=   ==
..
+            -
*             /
not          - (unary)
^
Operators are also said to have associativity, which is a way of describing which expressions are performed first when the operators have equal precedence. In the script engine, all binary operators are left associative, which means that whenever two operators have the same precedence, the operation on the left is performed first. The exception is the exponentiation operator (^), which is right-associative.

When in doubt, you can always use explicit parentheses to control precedence. For example:

a + 1 < b/2 + 1

...is the same as:

(a + 1) < ((b/2) + 1)

...and you can use parentheses to change the order of the calculations, too:

a + 1 < b/(2 + 1)

In this last example, instead of 1 being added to half of b, b is divided by 3.
__________________
Check out the new MSI Factory 2.0!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Input Text ?? octane6228 AutoPlay Media Studio 5.0 25 02-21-2004 04:59 PM
Incrementing a table name arnaud AutoPlay Media Studio 5.0 4 01-13-2004 06:36 PM
An utility to convert text files containing lists of values into pastable table code Corey AutoPlay Media Studio 5.0 4 12-06-2003 02:17 PM
Creating a Table of Contents Desmond AutoPlay Media Studio 5.0 Examples 0 10-03-2003 12:35 PM


All times are GMT -6. The time now is 09:16 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software