A function that runs a command specified as a parameter
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: A function that runs a command specified as a parameter
I tried to do this:
Got this execution error when ADS is running:
Jimmy!
The key length limit of 25 did not work
Code: Select all
MsgBox('INDEX ON PadRight('+aFieldName[ff]+','+aFieldSize[ff]+',".") TO Inp_tmp UNIQUE')
StartFunction('INDEX ON PadRight('+aFieldName[ff]+','+aFieldSize[ff]+',".") TO Inp_tmp UNIQUE')
Code: Select all
Function StartFunction(cText)
Local bBlock := "{|| "+cText +"')}"
Local uResult
bBlock := &(bBlock) // <<<===####### Error
uResult := eval(bBlock)
return uResult
The key length limit of 25 did not work
- Attachments
-
- Безымянный.jpg (16.56 KiB) Viewed 7280 times
-
- Безымянный.jpg (106.12 KiB) Viewed 7285 times
Re: A function that runs a command specified as a parameter
hi,
we talk about which is a xBase Function but you use
so change it and try again
we talk about
Code: Select all
PadR()
Code: Select all
PadRight()
greetings by OHR
Jimmy
Jimmy
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: A function that runs a command specified as a parameter
I'll try it now. And still there is a parameter in quotes: "."
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: A function that runs a command specified as a parameter
I tried it. The same error occurs. probably because of the quotes. Probably we should use the option with parameters
Re: A function that runs a command specified as a parameter
Hi,
You can't use command, you need to use functions!
Command are 'converted' to functions with the include files when compiling. Instead of 'index on' you need to use 'dbcreateindex()'.
You can't use command, you need to use functions!
Command are 'converted' to functions with the include files when compiling. Instead of 'index on' you need to use 'dbcreateindex()'.
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: A function that runs a command specified as a parameter
hi!
Code: Select all
StartFunctTXT('DbCreateIndex("Inp_tmp", PadR('+aFieldName[ff]+','+aFieldSize[ff]+',"."), .T. ')
- Attachments
-
- Безымянный.jpg (102.96 KiB) Viewed 7266 times
Re: A function that runs a command specified as a parameter
hi,
build a String, which is incorrect, before pass to Function
build a String, which is incorrect, before pass to Function
greetings by OHR
Jimmy
Jimmy
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: A function that runs a command specified as a parameter
hi!
Fixed
Fixed
Code: Select all
MsgBox('DbCreateIndex("Inp_tmp", PadR('+aFieldName[ff]+','+aFieldSize[ff]+',"."), .T.)')
StartFunctTXT('DbCreateIndex("Inp_tmp", PadR('+aFieldName[ff]+','+aFieldSize[ff]+',"."), .T.)')
Code: Select all
******************************************************************************************
******** Функция, которая запускает команду, заданную в виде текстового параметра
******************************************************************************************
Function StartFunctTXT(cText)
Local bBlock := "{|| "+cText +"')}"
Local uResult
bBlock := &(bBlock) // <<<===####### Error
uResult := eval(bBlock)
return uResult
******************************************************************************************
- Attachments
-
- Безымянный.jpg (15.58 KiB) Viewed 7258 times
-
- Безымянный2.jpg (106.31 KiB) Viewed 7258 times