how do you use IP_CLIENT_OPEN to get info from a website?
Comments
-
That comment just made my morningYeah, don't want to get into a parameter with the lingo police.
I may be missing some blatently obvious sarcasm, but what would you have to re-write? It's just semantics.Oh, boy, am I in trouble. I'm one of those people who has used the terms pretty much interchangeably. Now I'm going to have to go back and rewrite all my code. -
Ok, I'm back! Long week of work. Non-amx-related, unfortunately.
Back to multi-dimensional arrays:
I understand the concept of 2-dimensional and 3-dimensional arrays, which is what John used for the example above. I get that a multi-dimensional array (sElementstoParse)was used in order to store each search string type. Makes sense to me, in that the array can be searched easier as it is better organized. John, what is the purpose of making the array a size of [16][30], as opposed to [8][30], which would fit the 8 elements? Was that just a quickly-sized array so that you knew there was going to be enough space, or is there something else I'm missing with that? If so, does the same hold true for the sWeatherElements array? -
Ok, I'm back! Long week of work. Non-amx-related, unfortunately.
Back to multi-dimensional arrays:
I understand the concept of 2-dimensional and 3-dimensional arrays, which is what John used for the example above. I get that a multi-dimensional array (sElementstoParse)was used in order to store each search string type. Makes sense to me, in that the array can be searched easier as it is better organized. John, what is the purpose of making the array a size of [16][30], as opposed to [8][30], which would fit the 8 elements? Was that just a quickly-sized array so that you knew there was going to be enough space, or is there something else I'm missing with that? If so, does the same hold true for the sWeatherElements array?
Gotta run out real quick so I'll come back to this tomorrow, but the array sElementsToParse is actually a 2-dimensional character array with 16 elements. Initially I was keeping it to a 2-dimensional array to avoid the waste of a much larger ragged array (google "ragged array") and then just keeping track of the elements as being even or odd with this line:sWeatherElements[nParseLoop] = fnWeatherAttrParse(sElementsToParse[(((nParseLoop-1)*2)+1)],sElementsToParse[(((nParseLoop-1)*2)+2)],cBuffer)
The array looks like an 8 row array because of the way I typed it. I typed it that way for easy editing and readability.
And also, the line of code above could be reduced tosWeatherElements[nParseLoop] = fnWeatherAttrParse(sElementsToParse[((nParseLoop*2)-1)],sElementsToParse[(nParseLoop*2)],cBuffer)
No special reason behind doing it the first way except it was the way my mind processed it when I first typed that line of code. I don't want anyone starting a parameter with me about the way I coded that line
.
--John -
John Gonzales wrote: »
sWeatherElements[nParseLoop] = fnWeatherAttrParse(sElementsToParse[(((nParseLoop-1)*2)+1)],sElementsToParse[(((nParseLoop-1)*2)+2)],cBuffer)
That is some line of code, it goes right off the edge of my screen!
Paul -
That is some line of code, it goes right off the edge of my screen!
Paul
--John
.. -
Yeah, after I re-read the code, I saw the 16 items. I'm just not used to (at least yet) writing code that way, but it definitely makes sense for readability once you know what to look for. I have not tried to compress my code at all yet as I want to see all the inner workings first:
DEFINE_FUNCTION fcnWeatherCurr() { STACK_VAR nCurrStart STACK_VAR nCurrEnd STACK_VAR CHAR cCurrCondition[30] IF (FIND_STRING(dvIPWeatherBuff, 'yweather:condition',1)) { nCurrStart = (FIND_STRING(dvIPWeatherBuff, 'yweather:condition',1)+26) nCurrEnd = (FIND_STRING(dvIPWeatherBuff, '"', nCurrStart)) cCurrCondition = MID_STRING(dvIPWeatherBuff, nCurrStart, (nCurrEnd-nCurrStart)) } SEND_COMMAND dvJVCLT37X898Tp, "'^TXT-25,0,',cCurrCondition"
Specifically with this function, I had to do a +26(after counting out the characters in the source) to get the start character to the beginning of the actual current conditions description. Is this ok to do, or should I be implementing another variable to do this for me? I feel like there should be a better way.
Leave a Comment
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums