Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

How to Show Source Code Alpha

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to Show Source Code Alpha

    Can I see an example of calling?

    I want to call this from a database
    <% a5 a5w_include ("style.a5w")%>

    I am try like this
    ============================
    <%a5
    template=<<%html%

    %html%
    {ds.data(link)}
    delete cn
    dim cn as sql::Connection

    dim flag as l
    cn.open("::Name::Connection")

    cn.Execute("SELECT * FROM tbl_theme ")

    rs = cn.ResultSet
    dim html as c
    html =a5_mergeDataIntoTemplate(template,rs)
    ?html

    cn.FreeResult()
    cn.Close()
    %>
    ================================

    Not Work

    #2
    Re: How to Show Source Code Alpha

    The
    Code:
    <% a5 a5w_include ("style.a5w")%>
    should be
    Code:
    <%a5 a5w_include("style.a5w") %>
    , though I'm not sure what your doing with that exactly.

    This line {ds.data(link)} is meaningless. Maybe you borrowed this code from somewhere else, but you haven't defined ds or link. I think maybe you're going for
    Code:
    template=<<%html%
    {rs.data("link")}
    %html%
    where "link" would be the name of a column in the result set for the query "SELECT * FROM tbl_theme "

    Use the interactive window with debug(1) at the top of your code and step through it to figure out what the variables are.

    Comment


      #3
      Re: How to Show Source Code Alpha

      I've tried it but still error.
      data does not appear.
      in "style.a5w" that there is a code on the call that "alpha"

      Comment


        #4
        Re: How to Show Source Code Alpha

        my mean:

        I have a page "style.a5w" like this:

        http://pastebin.com/EFtED7Kk


        and I call to the database in the table "tbl_theme".
        when I call to include in the fild "link".

        Data does not appear.

        Comment


          #5
          Re: How to Show Source Code Alpha

          Exactly what error do you receive?

          And, as Chris said, {ds.data("value")} will not work in your script. You are trying to pull data from the table, which would be more like this (using my syntax):

          dim cn as sql::connection
          dim rs as sql::resultset
          cn.open("::name::conn")
          vsql = "SELECT * FROM table"
          cn.execute(vsql)
          rs = cn.resultset
          txt = <<%html%

          Hi my name is {rs.data("firstname")}.

          %html%
          txt = evaluate_string(vsql)
          ?txt
          '''''''''''''''''''''''''''''''''''''''''''''''''

          The evaluate_string() function replaces the variable with the string value. the variable is rs.data("firstname") in that line. Another way to write that line is just:
          txt = "Hi my name is " + rs.data("firstname")
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Re: How to Show Source Code Alpha

            hi steve
            I am still a newbie.

            can i know the full script ??
            if like this?

            <%a5
            dim cn as sql::connection
            dim rs as sql::resultset
            cn.open("::name::connection")
            vsql = "SELECT * FROM tbl_theme"
            cn.execute(vsql)
            rs = cn.resultset
            txt = <<%html%

            test {rs.data("firstname")}.

            %html%
            txt = evaluate_string(vsql)
            ?txt
            cn.FreeResult()
            cn.Close()
            %>

            Comment


              #7
              Re: How to Show Source Code Alpha

              What you are trying to do is advanced, so please tell us what you are trying to accomplish and where or why did you attempt to use this particular method?
              Steve Wood
              See my profile on IADN

              Comment


                #8
                Re: How to Show Source Code Alpha

                I want to create a simple website, which can be like a "blogger".
                in order to enter data and change the cript on page editor.

                for the problem. I have some page that exists in this data page: http://pastebin.com/EFtED7Kk
                in the data that there is a script "alpha"

                and I want to call that data to "include" but include it in the table "tbl_theme" in the fild "link".

                Comment


                  #9
                  Re: How to Show Source Code Alpha

                  I rewrote and tested like below. Part of the problem on my earlier posts was I had NOT used the a5_mergeDataIntoTemplate() before so I should have gone to the Help first.

                  A couple things I did to make it work:
                  • Had to take the code OUT of between the start and end Style tag. That was causing the entire <%a5...%> to fail. That is why you see the start and ending Style tag stored to the variable rather than your code in between the tags as normal HTML (see very first line of code).
                  • I changed the variable from html to lst. This probably didn't matter but I avoid using anything that might be a reserved word or be confused with other terms on a web page.
                  • I cleaned up the code so that all of the templates are at the top and not so broken up as you had them, and all of the sql code follows. That makes it easier to read.
                  • I removed some redundant sql-xbasic.
                  • Note - the only reason the template is broken into two sections is because one pulls from table records where id_body=7 and the other where id_body=8. If they were all from the same table, it could all be one template.
                  • Another important addition was the line dim rs as sql::resultset.
                  • And I notice if there is one little error in the template or the data source field name does not exists, the template fails without any error message.



                  dim lst as c = "<style>" + crlf()

                  template1=<<%html%
                  .hov:hover {
                  -webkit-box-shadow: 0px 2px 6px #333;
                  -moz-box-shadow: 0px 2px 6px #333;
                  box-shadow: 0px 0px 6px #333;
                  background-color: #FAF8F8;
                  color:#000000;
                  cursor:pointer;
                  }

                  .navbar li a:hover, .navbar li a.active{
                  color: {ds.data("color")} !important;
                  }

                  %html%

                  template2=<<%html%
                  .navbar-inverse .navbar-nav>
                  .active>a,
                  .navbar-inverse .navbar-nav>
                  .active>a:hover,
                  .navbar-inverse
                  .navbar-nav>
                  .active>a:focus{
                  color:#3276b1;
                  }

                  .navbar li.nav-dropdown .caret{
                  border-top-color: #fff;
                  border-bottom-color: #fff;
                  }

                  .navbar li a{
                  font-family: '{ds.data("fontfamily")}';
                  font-size: {ds.data("fontsize")}px;
                  color: {ds.data("color")} !important;
                  -ms-transition: all 100ms ease-in-out 0s ;
                  -moz-transition: all 100ms ease-in-out 0s ;
                  -webkit-transition: all 100ms ease-in-out 0s ;
                  -o-transition: all 100ms ease-in-out 0s ;
                  transition: all 100ms ease-in-out 0s ;
                  }
                  %html%

                  dim cn as sql::Connection
                  dim rs as sql::resultset
                  cn.open("::name::conn")

                  cn.Execute("SELECT * FROM body where id_body=8")
                  rs = cn.ResultSet
                  lst = lst + a5_mergeDataIntoTemplate(template1,rs)

                  cn.Execute("SELECT * FROM body where id_body=7")
                  rs = cn.ResultSet
                  lst = lst + a5_mergeDataIntoTemplate(template2,rs)

                  cn.Close()

                  lst = lst + crlf() + "</style>"

                  ?lst
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    Re: How to Show Source Code Alpha

                    Thank you Steve.
                    its work.

                    then how his calling. when the file === a5w_include ("style.a5w") === put it on the table "tbl_theme" and in the fild "link", while on the call with this script:
                    HTML Code:
                    template=<<%html%
                    {ds.data("link")}
                    %html%
                    
                    delete cn
                    dim cn as sql::Connection
                    
                    dim flag as l
                    cn.open("::Name::Connection")
                    
                    cn.Execute("SELECT * FROM tbl_theme ")
                    
                    rs = cn.ResultSet
                    dim html as c
                    html =a5_mergeDataIntoTemplate(template,rs)
                    ?html
                    
                    cn.FreeResult()
                    cn.Close()
                    dim cn as sql::connection
                    dim rs as sql::resultset
                    cn.open("::name::connection")
                    vsql = "SELECT * FROM tbl_theme"
                    cn.execute(vsql)
                    rs = cn.resultset
                    txt = <<%html%

                    {rs.data("link")}.

                    %html%
                    txt = evaluate_string(vsql)
                    ?txt
                    does not appear.

                    Comment


                      #11
                      Re: How to Show Source Code Alpha

                      You have to ignore my example in that post (#5) because it is completely wrong, because I did not understand how a5_mergeDataIntoTemplate() worked.

                      And I cannot figure out what you want to do now. Are you trying to stuff the contents of style.a5w into a table field named "link"?

                      If you are using a5w_include("style.a5w") in code, there is no space between a5w_include and the parenthesis. Its a5w_include("style.a5w") not a5w_include ("style.a5w").
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: How to Show Source Code Alpha

                        yes steve,
                        I mean a5w_include("style.a5w") without spaces.

                        I call <%a5 a5w_include("style.a5w") %> from the database, it is not the content that appears on <%a5 a5w_include("style.a5w")%> However, the emerging "<%a5 a5w_include(" style. a5w ")%>"

                        Comment


                          #13
                          Re: How to Show Source Code Alpha

                          What exactly do you mean by "I call <%a5 a5w_include("style.a5w") %> from the database"?

                          You may need to make a video (with or without sound) to show what you are doing. Many of us use a free product named Jing to make videos (http://www.techsmith.com/jing.html).
                          Steve Wood
                          See my profile on IADN

                          Comment


                            #14
                            Re: How to Show Source Code Alpha

                            this steve
                            http://screencast.com/t/BdJRRpt87

                            without sound

                            Comment


                              #15
                              Re: How to Show Source Code Alpha

                              Code:
                              rs = cn.ResultSet
                              dim html as c
                              html =a5_mergeDataIntoTemplate(template,rs.data[COLOR="#FF0000"]('link')[/COLOR])
                              ?html
                              
                              cn.FreeResult()
                              cn.Close()
                              I am not sure this will fix the problem you have
                              the way to get a particular field is to identify that in the rs.data stream
                              see above.
                              thanks for reading

                              gandhi

                              version 11 3381 - 4096
                              mysql backend
                              http://www.alphawebprogramming.blogspot.com
                              [email protected]
                              Skype:[email protected]
                              1 914 924 5171

                              Comment

                              Working...
                              X