Okay fine. But, stick it into Manager and put in a zillion test caes. Add it to your application porfolio after exhaustive regression tests. Part of using any programming language is building a common library.JDionne wrote: I like the inlist funuction...but I dont understand it. I will not use something that I dont understand in a production job. I just cant do that.
Case Statment
Moderators: chulett, rschirm, roy
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
That tested for you?kcbland wrote:Here's your logic corrected:
Begin Case
* (PACIFIC TRADE GENERAL):
Case ( Arg1 = '588' Or Arg1 ='570' Or Arg1 ='580' Or Arg1 ='582' Or Arg1 ='583' Or Arg1 ='560' Or Arg1 ='559' Or Arg1 ='549' Or Arg1 ='565' Or Arg1 ='557' Or Arg1 ='552' Or Arg1 ='538' Or Arg1 ='555' Or Arg1 ='579' Or Arg1 ='566' Or Arg1 ='546' Or Arg1 ='574' Or Arg1 ='561' Or Arg1 ='684' Or Arg1 ='553') AND NOT(Arg2 = 'MARSHAL ISL' OR Arg2 = 'KWAJALEIN')
Ans = 'PACIFIC TOTAL'
End Case
Now i get the error:
Test completed.
Result = Program "TSTcasetest.B": Line 5, Variable "ANS" previously undefined. Empty string used.
as if they all failed the test.....
we are moving here though. I will study your answer more
Jim
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Try splitting the statement up to make it more readable. You can put your codes into an array, kind of like setting a constant, then refer to this list anywhere in your code.
You can also set up code lists for other regions and run multiple LOCATE statements.
Code: Select all
PacCodes = '588':@FM:'570':@FM:'580':@FM:'582':@FM:'583':@FM:'560':@FM:'559':@FM:'549':@FM:'565':@FM:'557':@FM:'552':@FM:'538':@FM:'555':@FM:'579':@FM:'566':@FM:'546':@FM:'574':@FM:'561':@FM:'684':@FM:'553'
PacLocs = 'MARSHAL ISL' :@FM:'KWAJALEIN'
Ans = ""
* (PACIFIC TRADE GENERAL):
LOCATE Arg1 IN CheckCodes SETTING FoundCode THEN
LOCATE Arg2 IN CheckLocs SETTING FoundLoc THEN
Ans = 'PACIFIC TOTAL'
end
end
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn