Click here to Skip to main content
16,020,424 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 13:32
sitebuilderLuc Pattyn25-Aug-10 13:32 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini25-Aug-10 13:54
Sam Martini25-Aug-10 13:54 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 13:59
sitebuilderLuc Pattyn25-Aug-10 13:59 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini25-Aug-10 14:20
Sam Martini25-Aug-10 14:20 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 14:22
sitebuilderLuc Pattyn25-Aug-10 14:22 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler26-Aug-10 2:55
johannesnestler26-Aug-10 2:55 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini26-Aug-10 4:21
Sam Martini26-Aug-10 4:21 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler3-Sep-10 23:05
johannesnestler3-Sep-10 23:05 
Thank you for your long reply.
I've read the whole conversation, and I'm aware this things can be done in other languages - in C you would do it with the pre-processor... others mentioned it.
So you want't to do this now with .Net, - This lead me to my "not so nice" answer. I just wanted to mention, there a good reasons not to use pre-processors with "textual replacement" any more. If you are planing your framework, you shouldn't force the callers to know which variable names to use, so I said "learn about parameter passing".

@4: This is not so difficult: "Powerful technique" - is the wrong word for "textual replacement" - this is what you wan't. So personally I'm happy with no pre-processing and textual replacement any more. I was a C/C++ programmer long enough to know about the power of macros, but I never missed the nasty debugging (real compile-time type-checking is not possible for the compiler).
Today I would use a "hashtable/dictionary - workarround" you showed, or generate the code on the fly, or use reflection - but the best you can do - check your requirement and think realy hard if you need this. I'm for sure not the smartest person on the planet - but I'm programming for a living for enough years now to "smell" a bad solution. I wanted to do the same thing in the past, but I resisted, and found a better solution. -Again, please don't be angry about my "learn about basics"-statement.

I hope you find a nice solution for your framework and users!
greetings

Rose | [Rose]
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini5-Sep-10 6:55
Sam Martini5-Sep-10 6:55 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler5-Sep-10 12:17
johannesnestler5-Sep-10 12:17 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini5-Sep-10 23:49
Sam Martini5-Sep-10 23:49 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Dave Kreskowiak26-Aug-10 3:37
mveDave Kreskowiak26-Aug-10 3:37 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini26-Aug-10 4:46
Sam Martini26-Aug-10 4:46 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
johannesnestler3-Sep-10 23:18
johannesnestler3-Sep-10 23:18 
JokeRe: Get the Variable name which passed the value to the Parameter Pin
Peter_in_278025-Aug-10 13:48
professionalPeter_in_278025-Aug-10 13:48 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 13:56
sitebuilderLuc Pattyn25-Aug-10 13:56 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Peter_in_278025-Aug-10 14:33
professionalPeter_in_278025-Aug-10 14:33 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
PIEBALDconsult25-Aug-10 15:53
mvePIEBALDconsult25-Aug-10 15:53 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Luc Pattyn25-Aug-10 16:42
sitebuilderLuc Pattyn25-Aug-10 16:42 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini25-Aug-10 14:16
Sam Martini25-Aug-10 14:16 
AnswerRe: Get the Variable name which passed the value to the Parameter Pin
PIEBALDconsult25-Aug-10 15:55
mvePIEBALDconsult25-Aug-10 15:55 
GeneralRe: Get the Variable name which passed the value to the Parameter Pin
Sam Martini26-Aug-10 3:07
Sam Martini26-Aug-10 3:07 
QuestionNewbie trying to Magnify Flash Object... Pin
Berserker7Force24-Aug-10 14:06
Berserker7Force24-Aug-10 14:06 
QuestionHow to make a button that will copy two files and put them somewhere else Pin
mshome7724-Aug-10 1:37
mshome7724-Aug-10 1:37 
QuestionRe: How to make a button that will copy two files and put them somewhere else Pin
Covean24-Aug-10 2:08
Covean24-Aug-10 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.