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

end while error - xbasic array Multiple SMS twilio

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

    #31
    Re: end while error - xbasic array Multiple SMS twilio

    Yep looked there - no errors on their end - only the successful sends. From what I can tell the code is not executing from the resultset like how I think it should in my head. It seems to me the right way to do this would be to first get a count of the result then loop through them. the nextrow method doesn't seem to be working like I think it should.
    Now that said - I have no clue how to setup a for loop for the result set...for instance in the debugger as it loops through the rows I would think the vSendNumber variable would change as it loops through but I never see the value.
    It just seems to me if I can send once I can send for each record in the result set - it really blows when things don't work as expected...
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    Comment


      #32
      Re: end while error - xbasic array Multiple SMS twilio

      You have so much going on here, and you are understandably concerned about the privacy of the people in your table.
      With that said, based on what you're experiencing, there is obviously a problem somewhere.

      My advice is free, and should probably be tempered as such. More often than not, advice is worth what you pay for it.
      Sometimes however, you cannot put a price on free advice.

      I am more than willing to do a screen sharing session with you. I might see things in data that you miss (easy to do when
      it's data you deal with all the time. The code below is designed to force any obvious imperfections to be seen.
      There may be other errors based on different rules that I am unaware of.
      I'm still up and awake and willing to talk. Feel free to call me (608)345-2697 to pound through this if you want.

      Gregg
      P.S. This code is designed to be within a function, and you will have to provide the connection name

      [code]
      dim qResults[0] as p
      dim args as sql::arguments
      dim cn as sql::connection
      dim sqlCode as c
      dim itsOpen as l
      dim itWorked as l

      sqlCode = <<%txt%
      SELECT coalesce(Employee_phone,'000-000-0000') as Employee_phone, Sending_Data
      FROM alphanwcopro.send_tasks
      WHERE Date = :thedate AND company_id = :coid
      %txt%

      if .not. itsOpen then
      itsOpen = cn.open("::name::<connection"
      end if
      if .not. itsOpen then
      exit function
      end if
      'Be sure your arguments are set before processing the next line
      itWorked = cn.ToPropertyArray(sqlCode, args, qResults)
      debug(1)
      Gregg
      https://paiza.io is a great site to test and share sql code

      Comment


        #33
        Re: end while error - xbasic array Multiple SMS twilio

        thanks that a very generous offer - its always fun to get together with another developer who speaks Alpha!
        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

        Comment


          #34
          Re: end while error - xbasic array Multiple SMS twilio

          Glad to do it. It appears I have the office running smoothly today (several people now working from home).
          I know the frustration of APIs that don't work even though everything seems to suggest they should.
          Gregg
          https://paiza.io is a great site to test and share sql code

          Comment


            #35
            Re: end while error - xbasic array Multiple SMS twilio

            NWCOPRO Training & Help

            Please join my meeting from your computer, tablet or smartphone.

            https://www.gotomeet.me/nwcopro


            Working on this live - if your interested join the meeting. There might be some actual live data involved so please no screenshots or recording unless its for your own personal use, not that there is any sensitive data anyway...
            If you want to join or just hang out feel free. I am hoping to solve this issue and or maybe learn a few things while hanging out.

            You can also dial in using your phone.
            (For supported devices, tap a one-touch number below to join instantly.)

            United States: +1 (872) 240-3311
            - One-touch: tel:+18722403311,,984944085#

            Access Code: 984-944-085


            New to GoToMeeting? Get the app now and be ready when your first meeting starts: https://global.gotomeeting.com/install/984944085
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #36
              Re: end while error - xbasic array Multiple SMS twilio

              Had a great call with Gregg, together (mostly his help) we came up with working code: See if you can spot the part that makes it work over the previous code that didn't...

              Code:
              FUNCTION SendTw AS C (e as p)
              
              debug(1)
              '==CONNECTION AND VARS
              dim cn as SQL::Connection
              dim vHasError as c
              dim cf as extension::CurlFile
              dim flag_1 as l
              dim ce as extension::Curl	
              dim vSendNumber as c
              dim args as sql::arguments
              dim vUser as c
              dim SendTw as c
              dim vResult[0] as p
              
              cn.open("::Name::Connection1")
              args.Add("thedate",convert_type(e._CurrentRowDataNew.Date,"D"))
              args.Add("coid",e._CurrentRowDataNew.company_id)
              
               
              vSelect = "SELECT Employee_phone, Sending_Data FROM alphanwcopro.send_tasks WHERE Date = :thedate AND company_id = :coid"
              
              cn.topropertyarray(vSelect,args,vresult)
              vHasError = "N"
              
              
              
              vTwilioURLPre= "https://api.twilio.com/2010-04-01/Accounts/"
              vSID = "*******bf919b1724bc6d0"
              vTwilioURL=vTwilioURLPre+vSID+"/Messages.json"
              vToken = "******"
              vPassword=vSID+":"+vToken
              vFromNumber="+16303330311"
              vFrom="&From="+vFromNumber
              vSubject = "Job Assigments" 'irrelevant really to the SMS
              
              
              
              
              ce = extension::Curl.Init()
              ce.setOpt("URL",vTwilioURL)
              ce.setOpt("NOPROGRESS",1)
              ce.setOpt("USERPWD",vPassword)
              ce.setOpt("USERAGENT","curl/7.34.0")
              ce.setOpt("MAXREDIRS",50)
              ce.setOpt("CAINFO","C:\\Program Files (x86)\\a5V12\\CARoot\\ca-cert.pem")
              ce.setOpt("CAPATH","C:\\Program Files (x86)\\a5V12\\CARoot")
              ce.setOpt("CUSTOMREQUEST","POST")
              ce.setOpt("TCP_KEEPALIVE",1)
              
              
              
              for each banana in vresult
              	'debug(1)
              if eval_valid(banana.Employee_phone) then
              
              vSendNumber= banana.Employee_phone
              vMessage = banana.Sending_Data
              vTo="&To=+1"+remspecial(vSendNumber)
              vBody = "Body="+urlencode(vMessage)	
              vPostFields=vBody+vFrom+vTo
              ce.setOpt("POSTFIELDS",vPostFields)
              ce.setOpt("POSTFIELDSIZE_LARGE", len(vPostFields) )
              ce.SetOpt("FILE",cf)
              
              flag_1 = ce.Exec()
              if flag_1 then
              
                  dim headers as c
              	dim contents as c
              	headers = cf.GetHeaders()
              	contents = cf.GetContent()
              end if
              
              
              end if
              
              next
              ce.close()
              cn.Close()
              
              end function
              NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

              Comment


                #37
                Re: end while error - xbasic array Multiple SMS twilio

                The call was great, and our hang up time was perfect.
                Dinner arrived within 5 seconds of us hanging up.
                Gregg
                https://paiza.io is a great site to test and share sql code

                Comment

                Working...
                X