File Exchange
Try Origin for Free
The Origin Forum
Home
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
|
Send File to Tech support
All Forums
Origin Forum for Programming
Forum for Origin C
Prob. with enum as a parameter in a Command Window
Note:
Only the poster of this message, and the Moderator can edit the message.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Forum:
Forum for Origin C
Subject:
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
Origin Ver. and Service Release (Select Help-->About Origin): Operating System: Origin Pro 2017 (64 bit) SR 2; b9.4.2.380 Windows 10. Hello everyone! I have a problem with passing an enum instance to the function via Command window, where as if I call a separate function and do the same everything works as expected. Here is the minimum working example and the output: [code] #include <Origin.h> typedef enum {first, second,third} Numbers_type; void Somesomefunc123456(Numbers_type num) { switch (num) { case first: out_str("is 1"); break; case second: out_str("is 2"); break; default: out_str("somenum"); } } void anotherfunc() { Somesomefunc123456(first); } [/code] Call stack + output: [code]9> Somesomefunc123456(first) Command Error! 10> anotherfunc() is 1 12> Somesomefunc123456(1) is 2 13> Somesomefunc123456(0) is 1 [/code] Why the direct call via enum does not work? I need enum names like first, second and not integers for the actions, that the function will perform on the whole project (multiple folders, subfolders etc.), so simply passing numbers is not a solution I am looking for Thank you in advance
Check here to subscribe to this topic.
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000