Sign in to follow this  
Followers 0
ZebrasInBlankets

Large Case Statment?

4 posts in this topic

I need to make a script that checks for a number and then returns information based on that number.

I have a couple hundred numbers and text to go with each number.. ie:

212   bob
213   bill

I need it to search for the number then display the text that is part of that number with _filewritelog

Is there anyway to do this without using lame ini files or a giant Select statement.

Select
   Case $num = 1 
        _FileWriteLog(..)
   Case $num = 2 
        _FileWriteLog(..)
   Case $num = 3 
        _FileWriteLog(..)
EndSelect

making a giant case statement would be horrific since I am looking at hundreds of numbers.

Share this post


Link to post
Share on other sites



Could you put all of the numbers and corresponding names in a *.csv file ?

Download and try the attachment. It uses an Excel created spreadsheet (*.csv) to offer names and display two additional cells of information.

test_csv.zip

Share this post


Link to post
Share on other sites

I need to make a script that checks for a number and then returns information based on that number.

search the forum (v3 Scripts and Scraps) for "+Hash +Table +UDF". mrider has written some hash functions that might help you.

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0