Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encounter error when execute InputQuery in XE4 #73

Closed
ccy opened this issue Dec 25, 2013 · 1 comment
Closed

Encounter error when execute InputQuery in XE4 #73

ccy opened this issue Dec 25, 2013 · 1 comment

Comments

@ccy
Copy link
Contributor

ccy commented Dec 25, 2013

I use InputQuery defined in unit uPSI_Dialogs.pas. I am using XE4.

When I execute InputQuery in PascalScript, I encounter

"Exception: Length of value array must be >= length of prompt array"

I think it is due to InputQuery has 3 overloaded functions defined in vcl.Dialogs.pas:

function InputQuery(const ACaption: string; const APrompts: array of string; var AValues: array of string; CloseQueryFunc: TInputCloseQueryFunc = nil): Boolean; overload;

function InputQuery(const ACaption: string; const APrompts: array of string; var AValues: array of string; CloseQueryEvent: TInputCloseQueryEvent; Context: TObject = nil): Boolean; overload;

function InputQuery(const ACaption, APrompt: string; var Value: string): Boolean; overload;

How to make the InputQuery works in PascalScript using XE4?

@uschuster
Copy link
Contributor

We have just find the same issue. I have a fix in mind and will provide a pull request likely tomorrow.

uschuster added a commit to uschuster/pascalscript that referenced this issue Jul 13, 2018
Added an InputQuery wrapper because Delphi XE2 and higher have two additional versions of InputQuery, the pointer points to the wrong version and the execution fails with "Length of value array must be >= length of prompt array"
carlokok pushed a commit that referenced this issue Jul 13, 2018
* Fix for #180 (#180)

- enables VarArrayGet/-Set for Delphi 6 or higher
- since D5 VarArrayGet seems not to be accessible the best solution is to negate $IFNDEF DELPHI6UP into $IFDEF DELPHI6UP

* Fix for #73 (#73)

Added an InputQuery wrapper because Delphi XE2 and higher have two additional versions of InputQuery, the pointer points to the wrong version and the execution fails with "Length of value array must be >= length of prompt array"
carlokok pushed a commit that referenced this issue Sep 27, 2018
* Fix for #180 (#180)

- enables VarArrayGet/-Set for Delphi 6 or higher
- since D5 VarArrayGet seems not to be accessible the best solution is to negate $IFNDEF DELPHI6UP into $IFDEF DELPHI6UP

* Fix for #73 (#73)

Added an InputQuery wrapper because Delphi XE2 and higher have two additional versions of InputQuery, the pointer points to the wrong version and the execution fails with "Length of value array must be >= length of prompt array"

* Fix for #183 (#183)

Added a wrapper for TStringStream.Create(const AString: string) because Unicode Delphi has multiple constructors and the pointer points to the wrong overload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants