how to use any coding with 1 alphabet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RAMAND1
    New Member
    • Sep 2012
    • 2

    how to use any coding with 1 alphabet

    hi, my question is that how can we use any coding with 1 alphabet.
    like in module i made these-

    global c1 as string
    public function f1()
    c1="End If"
    End Function

    and then in form coding-

    after writing f1 to call f1
    can i use c1 instead of end if

    thanks
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    No, you can't. And why would you ever need to?

    Comment

    • RAMAND1
      New Member
      • Sep 2012
      • 2

      #3
      thanks for reply friend, i need it because i have to write some coding like this 200 times and every time something is different in the coding so i don't want copy paste also every time....i can say yes i can use copy paste too but want to make less coding app and want to know if it is possible......

      thanks !

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        I'm sure we've had some info posted here about executing VB (or VBA or VBScript) code from a string. It may be worth a quick search...

        Ahah! It's actually one that I wrote, back in 2007. See this link.

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          The only thing is that it requires additional coding. They're not wanting to run dynamic code, they want to change the required syntax. So instead of writing
          Code:
          If x Then
             Do y
          End If
          They want to write
          Code:
          If x Then
             Do y
          c1
          And they want it to compile. So they want the compiler to understand that c1 now means End If. Because it's apparently too time consuming to type End If.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Good point.

            I recommend using other tools such as MS Word to generate repetitive stuff, then copy/paste everything in one big operation. Also, perhaps ironically, you can write a VB program to generate the variations, perhaps based on a small input each time. I've done that sort of thing many times for things like generating test data and so on.

            Comment

            Working...