Can't create textblock with string from REQUEST(...
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-11-16 07:39 PM
‎2016-11-16
07:39 PM
My code:
REQUEST ("Zone_category", "", catname, code)
TEXTBLOCK "MY_TEXTBLOCK_1" 0, 5, 0, 1, 1, 0, catname
I get the error "requires an expression of type string"
But:
catname = "tmp_cat_name"
TEXTBLOCK "MY_TEXTBLOCK_1" 0, 5, 0, 1, 1, 0, catname
work without errors.
How I can get category name and create textblock with it?
Help me, please!)
7 REPLIES 7

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-11-16 09:58 PM
‎2016-11-16
09:58 PM
Maybe this is a bug in ArchiCAD. I dont't know.
But this works, if you want to use TEXT2:
x = REQUEST ("Zone_category", "", catname, code)
TEXT2 0, 0, catname
But this works, if you want to use TEXT2:
x = REQUEST ("Zone_category", "", catname, code)
TEXT2 0, 0, catname
Jochen Suehlo . AC12-28 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
GDL object creation: b-prisma.de
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-11-16 11:12 PM
‎2016-11-16
11:12 PM
Maybe at first before request:
catname = ""
guessing...had something similar lately.
Best Regards,
Piotr
catname = ""
guessing...had something similar lately.
Best Regards,
Piotr
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-11-17 04:40 AM
‎2016-11-17
04:40 AM
I tried:
catname = ""
REQUEST ("Zone_category", "", catname, code)
TEXTBLOCK "MY_TEXTBLOCK_1" 0, 5, 0, 1, 1, 0, catname
gives an error too (
catname = ""
REQUEST ("Zone_category", "", catname, code)
TEXTBLOCK "MY_TEXTBLOCK_1" 0, 5, 0, 1, 1, 0, catname
gives an error too (
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-11-17 04:53 AM
‎2016-11-17
04:53 AM
Tsepov wrote:It should work normally.
I tried:
catname = ""
REQUEST ("Zone_category", "", catname, code)
TEXTBLOCK "MY_TEXTBLOCK_1" 0, 5, 0, 1, 1, 0, catname
gives an error too (
I do not think that you accidentally forgot about the paragraph, but here is the complete code (simplified, without coefficients) just in case.
Catname = "" Catcode = "" QW= REQUEST("Zone_Category", "", Catname, Catcode) PARAGRAPH "NAMECAT" 2, 0, 0, 0, 1 ""+Catname ENDPARAGRAPH TEXTBLOCK "CAT" 0, 5, 0, 1, 1,1,"NAMECAT" RICHTEXT2 0, 1, "CAT"

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-11-17 06:15 AM
‎2016-11-17
06:15 AM
I find with REQUEST you always have to say xxx = REQUEST...
This is because it returns a value to xxx if the request is successful or not.
As well as returning the actual values you were requesting in the first place.
Barry.
This is because it returns a value to xxx if the request is successful or not.
As well as returning the actual values you were requesting in the first place.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-11-18 06:45 AM
‎2016-11-18
06:45 AM
Its work!
Catname = ""
Catcode = ""
QW= REQUEST("Zone_Category", "", Catname, Catcode)
PARAGRAPH "NAMECAT" 2, 0, 0, 0, 1
""+Catname
ENDPARAGRAPH
TEXTBLOCK "CAT" 0, 5, 0, 1, 1,1,"NAMECAT"
RICHTEXT2 0, 1, "CAT"
SL_GDL, many thanks for the help!
Catname = ""
Catcode = ""
QW= REQUEST("Zone_Category", "", Catname, Catcode)
PARAGRAPH "NAMECAT" 2, 0, 0, 0, 1
""+Catname
ENDPARAGRAPH
TEXTBLOCK "CAT" 0, 5, 0, 1, 1,1,"NAMECAT"
RICHTEXT2 0, 1, "CAT"
SL_GDL, many thanks for the help!
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-04-18 07:14 AM
‎2017-04-18
07:14 AM
to avoid errors with str var type after REQUEST it is better to do so:
QW= REQUEST("Zone_Category", "", Catname, Catcode)
IF QW <> 0 THEN ! if answeres more then 0
Catname_ = Catname
ELSE
Catname_ = ""
ENDIF
PARAGRAPH "NAMECAT" 2, 0, 0, 0, 1
Catname_
ENDPARAGRAPH
TEXTBLOCK "CAT" 0, 5, 0, 1, 1,1,"NAMECAT"
RICHTEXT2 0, 1, "CAT"
QW= REQUEST("Zone_Category", "", Catname, Catcode)
IF QW <> 0 THEN ! if answeres more then 0
Catname_ = Catname
ELSE
Catname_ = ""
ENDIF
PARAGRAPH "NAMECAT" 2, 0, 0, 0, 1
Catname_
ENDPARAGRAPH
TEXTBLOCK "CAT" 0, 5, 0, 1, 1,1,"NAMECAT"
RICHTEXT2 0, 1, "CAT"