RTC Forums
November 24, 2024, 02:46:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Records as remote function input parameters  (Read 4414 times)
dpcroghan
RTC Expired
*
Posts: 17


« on: December 24, 2013, 06:46:42 PM »

Hi Danijel,

I'd like to pass a record as an input parameter to a remote function, containing three strings: a file name, the directory name, and a security ID (hash code). How would I do this? Would I use the NewRecord method?

Thanks for your help!

Code:
// This works fine, but I'd like to include two more strings as input       
RtcClientModule1.Data.NewFunction('DeleteFile').asString['FilePath'] :=
          rdsClient.Request.Query['file'];

// How do initialize a record?
//RtcClientModule1.Data.NewFunction('DeleteFile').NewRecord()
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: December 24, 2013, 07:41:29 PM »

Did you see this Quick Start topic?

You can pass any structure you want as parameters to a remote function call and also receive any structure as a result. You can also pass multiple parameters without creating a separate record. It all depends on what you want or need.


RtcClientModule.Prepare('DeleteFile');

// FilePath := ...
RtcClientModule.Param.asString['FilePath']:= 'c:/filename.txt' ;
// FileSize := ...
RtcClientModule.Param.asInteger['FileSize']:= 12345;
// FileDate := ...
RtcClientModule.Param.asDateTime['FileDate']:= Now;

// Make a UserInfo record ...
RtcClientModule.Param.newRecord('UserInfo');
// UserInfo.FirstName := ...
RtcClientModule.Param.asRecord['UserInfo'].asString['FirstName']:= 'Peter' ;
// UserInfo.LastName := ...
RtcClientModule.Param.asRecord['UserInfo'].asString['LastName']:= 'Pan' ;

Best Regards,
Danijel Tkalcec
Logged
dpcroghan
RTC Expired
*
Posts: 17


« Reply #2 on: December 24, 2013, 08:45:12 PM »

I had not seen that link before, lots of good information that I will read. All I had found was Lesson 5. Thanks for the examples too.

Merry Christmas!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 16 queries.