realbasic-nug
[Top] [All Lists]

Re: declare w/ strings and arrays

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: declare w/ strings and arrays
From: Ken Mankoff <km2237 at columbia dot edu>
Date: Thu, 30 Sep 2004 15:32:10 -0400 (EDT)
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BD81AC54 dot 58B27%mars at realsoftware dot com>

On Thu, 30 Sep 2004, Mars Saxman wrote:

yeomans at desuetude dot com wrote:

First, the stringPtr work is unnecessary; you can pass an Rb String in the function, and somehow a CString will be what's actually fed to the function.

I don't believe that applies in this case; from his description, it sounds like the fourth parameter is an output buffer where nc_get_var1_text can write its results. If that is the case, then it would be very bad news to pass in an RB string; the CString type is equivalent to "const char*", not to "char*".


Correct. The fourth variable (strPtr) is an output of 1 string. The string is return from an n-dimensional array of strings. The exact string that the library returns is specified by passing in an array of indices (indexPtr).

The error message is this:
        Attempt to convert between text & numbers


I get this by calling the library function. It returns, but strPtr is empty. The error code returned by the function is set, and a lookup table translates the error code to the above message.

It sounds like everything is therefore working with the library call, and the dataset is wrong, or I am calling it a variable of the wrong type. But examining the data through other means, I am fairly confident that it is an array of strings, and there is something wrong with my code.

Thanks,

  -k.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>