Go to Post ADMIT IT! Dave Lavery has better legs than Amanda Morrison! - DCA Fan [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 15-02-2009, 13:58
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: Paramaterizing Case Statements

Yes. And no. (there, that was simple, right?)

The problems is that your question is not as simple as it may seem. It really depends on exactly what you are asking.

Yes, you can perform a calculation and wire it to an indicator and then use the indicator's local variable later in the program to read back the value. However, in general, if you can keep your value in a wire (i.e. instead of using local variables), your code will be faster and use less memory.

Note that for the size of the FRC projects, this is really not likely to make a difference in performance, but it's something to keep in mind as you use LabVIEW.

If you are asking if you can actually evaluate expressions as part of the case statement itself, then the answer is no. All of the case expression needs to be evaluated up front prior to the actual case statement.

What you could do is use enumerated types or strings to help make the case statement more legible. If you pass in the enumerated type or string for which you wanted to execute code, the case statement would display text for each case (more like a C switch statement).
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
printf statements Hazmatt Programming 2 09-02-2008 16:09
Using While Statements Sykan Programming 6 27-01-2008 12:29
impossible statements Dan Zollman Math and Science 28 20-08-2005 18:34
Conditional #define Statements Ian W. Programming 3 14-02-2004 18:14
Else Statements!!! Adam Shapiro Programming 9 22-12-2002 01:27


All times are GMT -5. The time now is 16:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi