FastScript Bug: The "IS" operator is not working correctly

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

FastScript Bug: The "IS" operator is not working correctly

Postby pmk65 » Wed Jun 14, 2017 2:28 pm

The "IS" operator only works if the value testing is a true match, otherwise it will throw an error. (Which makes it quite useless.)

This works and outputs the text "var is a TStringList" in message panel
Code: Select all
var SL = new TStringList;
if (SL is TStringList) Script.Message("var is a TStringList");
delete SL;


But when the var is NOT a TStringList, like in this example:
Code: Select all
var NUM = 33;
if (NUM is TStringList) Script.Message("var is a TStringList");


An error is displayed in message panel: "Access violation at address 004062C0 in module 'webuild.exe'. Read of address 00000021"
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: FastScript Bug: The "IS" operator is not working correct

Postby Aivars » Fri Jun 16, 2017 11:47 am

I'll see if it can be fixed.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: FastScript Bug: The "IS" operator is not working correct

Postby Aivars » Tue Jan 16, 2018 7:39 pm

We have checked this and the problem here is that NUM is literal. If it was an object then you would be fine, but in this case 33 is auto-converted to pointer, script tries to access object at that pointer (which, natuarally, does not exist) and everything goes kaboom. "IS" is mean for objects only and it can't be fixed without breaking other functionality.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: FastScript Bug: The "IS" operator is not working correct

Postby pmk65 » Tue Jan 23, 2018 2:53 pm

Bummer. I was hoping I could use it for some all-purpose variable detection/identifying.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 10 guests

cron