Senin, 06 Maret 2017

[smf_addin] Digest Number 3935

2 Messages

Digest #3935
1a
Using SMF on a Mac by jbsergeant
1b
Re: Using SMF on a Mac by "Randy Harmelink" rharmelink

Messages

Mon Mar 6, 2017 7:09 am (PST) . Posted by:

jbsergeant

Hi Randy:


I know you don't personally support the add-in on the Mac, but I just discovered that you had added support for the Mac by incorporating someone else's code, so I have been trying it out. I have discovered some issues which I'm hoping either the Mac developer or someone else who is using it on the Mac can help with.


First, it appears that a definition of the #Mac constant needs to be added manually at the top of the modules which have the conditional logic for the Mac, as in #Const Mac = True. I didn't see this documented anywhere. Am I missing something?


Second, it appears that in situations where a cookie is not necessary, for example getting data from Yahoo, the function cookieFiles in modMacCode is generating an error because this code results in ArrSize of -1


ScriptToRun = "do shell script " & Chr(34) & "find '" & bPath & "' -name '*_cookie.txt' -type f | awk -F/ '{print $NF}'" & Chr(34)
result = MacScript(ScriptToRun)
arr = Split(result, Chr(13))
ArrSize = UBound(arr)

ReDim retArr(ArrSize, 1)


This error prevents any of the Yahoo functions from working.


If I step through the code and manually bypass this, I am able to get, for example RCHGetYahooQuotes(StockTicker$, "sl1") to work correctly, so I think if this cookie handling logic can be cleaned up, the add-in will work well with Yahoo on the Mac.


Do we have any more experienced Mac coders here who can look at this?


John


Mon Mar 6, 2017 10:32 am (PST) . Posted by:

"Randy Harmelink" rharmelink

As far as I know, the #Mac variable is a compile directive that should be
set by the VBA environment.

What concerns me is that different versions of Mac O/S and/or EXCEL will
have different solutions. That's the reason I use the XML library and
manually extract data from source code, instead of using the HTML object
for extraction -- different versions of the O/S and EXCEL on the PC have
issues when I use the HTML object. And I only have one version of each. :)

Which again begs your question, do we have any more experienced Mac coders
here who can look at this?

On Mon, Mar 6, 2017 at 6:28 AM, john.sergeant@
​...wrote:

>
> I know you don't personally support the add-in on the Mac, but I just
> discovered that you had added support for the Mac by incorporating someone
> else's code, so I have been trying it out. I have discovered some issues
> which I'm hoping either the Mac developer or someone else who is using it
> on the Mac can help with.
>
> First, it appears that a definition of the #Mac constant needs to be added
> manually at the top of the modules which have the conditional logic for the
> Mac, as in #Const Mac = True. I didn't see this documented anywhere. Am I
> missing something?
>
> Second, it appears that in situations where a cookie is not necessary, for
> example getting data from Yahoo, the function cookieFiles in modMacCode
> is generating an error because this code results in ArrSize of -1
>
> ScriptToRun = "do shell script " & Chr(34) & "find '" & bPath & "' -name
> '*_cookie.txt' -type f | awk -F/ '{print $NF}'" & Chr(34)
>
> result = MacScript(ScriptToRun)
>
> arr = Split(result, Chr(13))
>
> ArrSize = UBound(arr)
>
> ReDim retArr(ArrSize, 1)
>
> This error prevents any of the Yahoo functions from working.
>
> If I step through the code and manually bypass this, I am able to get, for
> example RCHGetYahooQuotes(StockTicker$, "sl1") to work correctly, so I
> think if this cookie handling logic can be cleaned up, the add-in will work
> well with Yahoo on the Mac.
>
> ​​
> Do we have any more experienced Mac coders here who can look at this?
>
>
>
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar