|
#1
|
|||
|
|||
|
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"); |
|
#2
|
||||
|
||||
|
result = tableDatabaseSize[2];
should do it I would think. John |
|
#3
|
|||
|
|||
|
That is what i needed.
Merci! |
|
#4
|
|||
|
|||
|
do i miss multiply (* or x ) in math functions?
|
|
#5
|
||||
|
||||
|
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 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 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) 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 "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 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
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 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) ^ 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! |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
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.








Linear Mode

