08-04-2006, 05:30 PM
|
arguments and if/sel
|
|
08-04-2006, 06:06 PM
== compares strings if left operand is str. If it is lpstr, compares pointers. Use sel or matchw or strcmp or q_strcimp.
08-04-2006, 06:12 PM
i thought $a2 makes it str.
08-04-2006, 06:33 PM
Using lpstr for function arguments is better than str because:
1. Better performance. str would allocate and copy string. 2. Error when accidentally trying to pass a number. Use str if: 1. Performance is not important, or the string would be copied to str variable inside the function anyway. 2. To be able to pass strings and numbers. When you assign a number to a str variable, it is automatically converted to string.
08-04-2006, 06:39 PM
thanks for the lesson !
|
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)
