Help translating C

I'm trying to translate the following code to Delphi:

/* Start */
#define JSVAL_SETTAG(v,t)       ((v) | (t))
#define STRING_TO_JSVAL(str)    JSVAL_SETTAG((jsval)(str), JSVAL_STRING)

JSString * mystr;
jsval myjsval;

mystr = JS_NewStringCopyZ("test string");
myjsval = STRING_TO_JSVAL(mystr);
/* End */

This is to let a string be passed through a jsval array to a function call.
The problem is that, relative to mystr, I don't know which byte JSVAL_SETTAG
is modifying with JSVAL_STRING.

I've tried the following in Delphi, but get an access violation reading
address 0:

newjsval := jsval(@jsstr);
newjsval := newjsval OR JSVAL_STRING;

Thanks for any help you can provide,

Sterling


0
Sterling
7/12/2003 10:31:00 PM
netscape.mozilla.jseng 1530 articles. 0 followers. Follow

2 Replies
205 Views

Similar Articles

[PageSpeed] 28

Should've clarified the access violation...I get the AV when passing the
resulting newjsval to JS_CallFunctionName.

"Sterling Bates" <sblist*nospam*serv@bigbangco.com> wrote in message
news:beq1m5$cco1@ripley.netscape.com...
> I'm trying to translate the following code to Delphi:
>
> /* Start */
> #define JSVAL_SETTAG(v,t)       ((v) | (t))
> #define STRING_TO_JSVAL(str)    JSVAL_SETTAG((jsval)(str), JSVAL_STRING)
>
> JSString * mystr;
> jsval myjsval;
>
> mystr = JS_NewStringCopyZ("test string");
> myjsval = STRING_TO_JSVAL(mystr);
> /* End */
>
> This is to let a string be passed through a jsval array to a function
call.
> The problem is that, relative to mystr, I don't know which byte
JSVAL_SETTAG
> is modifying with JSVAL_STRING.
>
> I've tried the following in Delphi, but get an access violation reading
> address 0:
>
> newjsval := jsval(@jsstr);
> newjsval := newjsval OR JSVAL_STRING;
>
> Thanks for any help you can provide,
>
> Sterling
>
>


0
Sterling
7/12/2003 10:33:38 PM
I pointed out in private mail to Sterling that the @ below is the cause 
of the problem, and he'd already figured that out.  Just wanted to post 
in case anyone else is playing with Delphi and SpiderMonkey.

/be

>>newjsval := jsval(@jsstr);
>>newjsval := newjsval OR JSVAL_STRING;
>>
>>Thanks for any help you can provide,
>>
>>Sterling
>>
>>
> 
> 
> 

0
Brendan
7/14/2003 12:58:02 AM
Reply:

Similar Artilces:

HELP!HELP!HELP!HELP!HELP!HELP!
I was using powerbuilder4.0 a month ago I decided that migrate it to PB7.0 When Im using 4.0, in datawindows I was using extra colums additional to stores procedure. I mean that for example; stored proc. returns 4 columns. I was using 2 extra columns to modify something from client. But I cant do the same thing in PB7.0. How can I do that??? please help. Gurcan yucel gyucel@infina.com.tr "I was using 2 extra columns to modify something from client." what does this mean that you added to the result set? If so then just goto the SQL and add a param. Then set the...

Help Help Help Help Help Help
------=_NextPart_000_0074_01C2960E.EBE13A30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Can someone please help me. I have installed mysql on Unix Solaris and it works fine I have Perl installed previously which is working and with which i have installed other perlmodules before and are working fine. I have also installed DBI and it works fine with the Sybase drivers which i have installed. When i tried to install the Msql-Mysql-modules-1.2219 drivers i get the following error. # make /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/...

Help with C++ to Delphi translation
how would you tranlate this code to Delphi std::vector<int> MyList; MyList.resize(w * a); int *listed = &( MyList[0]); memset(listed, 0, width * height * sizeof(int)); if (listed[x*w+r] == 1) continue; Gilbert wrote: > how would you tranlate this code to Delphi Like this: {code:delphi} var MyList: array of Integer; listed: PInteger; {code} {code:delphi} SetLength(MyList, w * a); listed := @MyList[0]; ZeroMemory(listed, width * height * SizeOf(Integer)); .... if listed[x*w+r] = 1 then Continue; {code} If your version of D...

help translate C to VB
Hi all,Could anyone show me how to write the following code in VB?*-AvailableRoles is the id of a listbox for (int i = 0; i < AvailableRoles.Items.Count; i++) {            if (AvailableRoles.Items[i].Selected == true)                 Roles.AddUserToRole(CreateUserWizard1.UserName, AvailableRoles.Items[i].Value);        }Thanks for any help. It's something like this: Dim i As Integer = 0 While i < AvailableRoles.Item...

Help translate from dephi to c++?
Hi, I would like to translate following codes from delphi to c++. Could someone help me to convert? var i: integer; c: TfrxComponent; begin for i := 0 to frxReport1.AllObjects.Count - 1 do begin c := frxReport1.AllObjects.Items[i]; if c is TfrxMemoView then if TfrxMemoView(c).Tag = 1 then TfrxMemoView(c).Font.Size := 14; end; frxReport1.ShowReport(); end; Thanks in advance. Best Regards, Ni Ni On Tue, 24 Jul 2012 19:33:40 -0700, Ni Ni Win Hlaing <> wrote: >I would like to translate following codes from delphi to c++. >...

Help Help Help Help
i need to create a crosstab report using Crystal reprot for VS 2003 i face aproblem when i need to order my Fileds by their names my data must be like this Basic Cola Housing Gross Deduction1 Deduction2 Deduction3 Net but when i run my report it give my a not sorted data acutally i have acode field which can i order field using it. but i don't knwo how to do thisSo..................? Select Report tab | |-->Select Record Sort expert Choost the fields you want to sort --Select the corresponding sort direction f...

help help help help
Name: chef mario Email: chefusa_at_pacbell.net Product: Firefox Summary: help help help help Comments: Heard great reports about Firefox!!! Downloaded & installed Firefox !!!! Lost All my very very valuable BOOKMARKS!!! CAN ANYONE HELP!!!!! All bookmarks were in Internet Explorer Did bookmark transfer to Firefox. Seem the Fox eat all m,y bookmarks Need serious help anyone. chef mario Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051025 Firefox/1.5 ...

Help with PASCAL to C translation?
Hello all, I need to convert a CRC32 routine written in Pascal to C so I can port it to a Mac application. This is part of the SYSTOOLS package that was included in my old C++ Builder 5 installation (I think). There is a function (Crc32Prim) in STCRC.HPP that returns a CRC based on the following: {code} const Crc32Table : array[0..255] of DWORD = ( $00000000, $77073096, $ee0e612c, $990951ba, $076dc419, $706af48f, $e963a535, $9e6495a3, $0edb8832, $79dcb8a4, $e0d5e91e, $97d2d988, $09b64c2b, $7eb17cbd, $e7b82d07, $90bf1d91, $1db71064, $6ab020f2, $f3b97148, $84be41de, $1ada...

Please Help! translate VB to C# for me...
please translate this code to c# : If Not e.Exception Is Nothing Then If TypeOf (e.Exception) Is ArgumentException Then ErrorMessage.Text = CType(e.Exception, ArgumentExeption).Message Else ErrorMessage.Text = "ABC" End If e.ExceptionHandled = True e.KeepInEditMode = True End If Thanks a lot Hi, use a conversion tool like this one: http://converter.telerik.com/ (or one of the others) if (!e.Exception == null){ if ((e.Exception) is ArgumentException) {  ErrorMessage.Text = ((ArgumentExeption)e.Exception).Mess...

Help!help!help!
Whether can I set a window to be unmoveable when the application is run,whatever the window is normal or max when it's running?If it may be set,how.... ...

HELP HELP HELP
i need help, i use an dbmaker 3.0 server and now i want to use an client to go on it but i dont have an client(i have dbmaker 3.6 but it don't work) who can help me with the dbmaker 3.0 client (tools,files,drivers) email me kelly.kloen@siteways.nl ...

HELP HELP HELP
I need EAS 3.0.1 mantainance as soon as possible or at least an updated datawindow.jar. I've already asked the mantainance CD to italian Sybase support but they know nothing about it. If someone from sybase could send me an updated datawindow.jar would be very very appreciated. Please email me to m.mazza@ads.it Thank you Mauro Mazza Research & Develop - Gruppo FINMATICA E-mail: m.mazza@ads.it http://www.ads.it ADS automated data systems - Data Processing S.p.A. Via Del Lavoro, 17 40127 Bologna - Italy tel. +39 051 6307 411 fax. +39 051 6307 498 We expect t...

help help help
after i unload., theni install adaptaive server.......everythings running well but unluckily it cannot start the adaptive server when installing but backupserver and XP server can install and start it Building Adaptive Server "abc", unable to boot server "abc" server "abc" was not connected anyone can help me Was an errorlog created for this ASE in the ASE install directory? If so, what does it say? Zidane wrote: > after i unload., theni install adaptaive server.......everythings running > well > but unluckily it cannot st...

HELP HELP HELP
Hi again: Just tested my first test and proceeded to test and install a second time. This time I let the server run the update after registering with Novell. However, upon reboot the server was dorked as it could not read my /usr and /var partitions (fstab was bad). Now here is what changed between my first the second build: I added a separate partition for /usr, that is all. I could really use a hand here. If I can't trust the update mechanism ...... Chris. Chris wrote: > Hi again: Just tested my first test and proceeded to test > and install a second...

Web resources about - Help translating C - netscape.mozilla.jseng

Tutorial: Translating Your Applications Using Facebook’s Crowd-sourced Translation Service
One of the big announcements from Facebook’s F8 developer conference last week was the launch of access to Facebook’s translation tool for third ...

Twitter Blog: Translating Twitter into more languages
Twitter Blog Translating Twitter into more languages 2688550978861959319 Monday, February 14, 2011 Today we're announcing a product that is a ...

Chris Hedges on Roots of Terrorism, Free Speech Hypocrisy & Translating #JeSuisCharlie - YouTube
Abby Martin Breaks the Set on Boko Haram Apathy, Clash of Civilizations Falsehood & Chris Hedges Breaks the Set. LIKE Breaking the Set @ htt ...

Translating success: on form and fitting right in
Shinji Ono is showing what made him a star in Japan, writes Sebastian Hassett.

Translating Australia's linguistic diversity into language learning
Language luminaries hope &quot;outside the box&quot; thinking will enable Australia's rich multicultural community to play a bigger role in formal ...

Google Translate: instantly translating foreign language text
Google's latest update for Google Translate allows users to point their smartphone’s camera at foreign text and receive an instant translation ...

More Chinese translating online: report
Chinese are becoming increasingly dependent on translation tools that run online as well as on mobile devices, according to a report conducted ...

Translating law into business makes Fenwick unique
Translating law into business makes Fenwick unique People's Daily Online People's Daily Online As a law firm specializing in technology companies, ...

Translating Talent Into ‘Success': Another Look At Law School Pedigree
How does expected talent (as measured by law school credentials) correlate with other indicators of “success” (as measured by profits per partner)? ...

Translating From The Future
Tim Parks, in the throes of translating the Italian writer Giacomo Leopardi, muses on how to get it right: Fifteen years of diary entries. From ...

Resources last updated: 1/21/2016 10:01:40 PM