Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Posts
    50

    Unanswered: using variable in Include

    why in asp i cant include file using filename in variable

    dim file_to_include
    file_to_include="test.asp"
    for example include file_to_include


    it is not possible ???

    thanks for help

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    ASP makes a single pass through your code. To do so, it must first include all of the files that build your page. Once compiled, it then executes all the code sequentially, and sends the results to the browser. The only way "around" it is to wrap all of the possible combinations of include files in IF statements.. kinda ugly...
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    May 2003
    Posts
    50

    Unhappy how it can be ?????

    on my web page people can add languages to page dynamically,

    for example my www page works with two languages, russian and english
    web page administrator can add new language to www page database for example Latvia

    then clients on web page can choose between three languages,
    and when they chooos latvian (new lang) i must to add if statement to the code ??????

    it is not good !!!

    somebody knows any normal solution for taht problem, if statement it is not normal for programing !!!

    yeh

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    One method to accomplish this would be through the database.

    Your language types could be stored in the database, then all of the multi-lingual content would also be stored in the DB with a key to the language type.
    That which does not kill me postpones the inevitable.

  5. #5
    Join Date
    May 2003
    Posts
    50

    ...

    on my www page i have 2 types of translates.

    one types of translates are www page translates...

    for example
    ============================================
    include translate_eng.asp

    <%response.write(text_1)%><input type='text' name='input_1'></br>
    <%response.write(text_2)%><input type='text' name='input_2'>
    ============================================


    translate_eng.asp FILE contents is
    ============================================
    text_1="enter your name:"
    text_2="enter your last name:"
    ============================================

    translate_rus.asp FILE contents is
    ============================================
    text_1="bla bla bla "
    text_2="bla bla bla "
    ============================================

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •