modify ATTRIBUTE GET$ to also get the program directory/filename with a$=ATTRIBUTE GET$ "",""
This commit is contained in:
@@ -19,6 +19,7 @@ Value$ = ATTRIBUTE GET$ Name$, Filename$
|
|||||||
Get the string value of the attribute Name$ for file Filename$.
|
Get the string value of the attribute Name$ for file Filename$.
|
||||||
Returns "true" or "false" for "Bool" type attributes.
|
Returns "true" or "false" for "Bool" type attributes.
|
||||||
If Name$="", returns a list of attribute names and their types separated by " | ". returns "Unsupported" for types that are not valid for yab.
|
If Name$="", returns a list of attribute names and their types separated by " | ". returns "Unsupported" for types that are not valid for yab.
|
||||||
|
it name$ and filenbame$ both = "", returns the current program path and filename
|
||||||
Value = ATTRIBUTE GET Name$, Filename$
|
Value = ATTRIBUTE GET Name$, Filename$
|
||||||
Get the number value of the attribute Name$ for file Filename$.
|
Get the number value of the attribute Name$ for file Filename$.
|
||||||
|
|
||||||
@@ -458,6 +459,7 @@ Directory$ = PEEK$("directory")
|
|||||||
else
|
else
|
||||||
Directory$ = system$("pwd")
|
Directory$ = system$("pwd")
|
||||||
endif
|
endif
|
||||||
|
see also ATTRIBUTE GET$
|
||||||
TrackerItem$ = PEEK$("refsreceived")
|
TrackerItem$ = PEEK$("refsreceived")
|
||||||
Returns TrackerItem which you used 'open with...' your application on.
|
Returns TrackerItem which you used 'open with...' your application on.
|
||||||
Selected$ = POPUPMENU x,y, MenuItems$, View$
|
Selected$ = POPUPMENU x,y, MenuItems$, View$
|
||||||
|
|||||||
@@ -24,3 +24,4 @@ This will insure that the BuildFactory is refreshed with the current version.
|
|||||||
LICENSE: Artistic License -- Create your own stand-alone binaries with yab under any license you want.
|
LICENSE: Artistic License -- Create your own stand-alone binaries with yab under any license you want.
|
||||||
AUTHOR: jan__64
|
AUTHOR: jan__64
|
||||||
|
|
||||||
|
yab homepage: http://yab.orgfree.com/
|
||||||
@@ -9216,8 +9216,13 @@ const char* YabInterface::AttributeGet1(const char* name, const char* filename)
|
|||||||
{
|
{
|
||||||
BString tempname(name);
|
BString tempname(name);
|
||||||
BNode node(filename);
|
BNode node(filename);
|
||||||
if(node.InitCheck() != B_OK)
|
if(node.InitCheck() != B_OK){
|
||||||
|
if (tempname.Length() >0)
|
||||||
ErrorGen("Attribute file not found!");
|
ErrorGen("Attribute file not found!");
|
||||||
|
BString appdir = mainFileName;
|
||||||
|
return appdir;
|
||||||
|
}
|
||||||
|
|
||||||
if (tempname.Length() >0)
|
if (tempname.Length() >0)
|
||||||
{
|
{
|
||||||
attr_info attr;
|
attr_info attr;
|
||||||
@@ -9291,6 +9296,7 @@ const char* YabInterface::AttributeGet1(const char* name, const char* filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return List.String();
|
return List.String();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1665,6 +1665,8 @@ static double peek(char *dest, YabInterface *yab) /* peek into internals */
|
|||||||
else if (!strcmp(dest,"error")) return errorcode;
|
else if (!strcmp(dest,"error")) return errorcode;
|
||||||
else if (!strcmp(dest,"read_controls")) return read_controls;
|
else if (!strcmp(dest,"read_controls")) return read_controls;
|
||||||
else if (!strcmp(dest,"isbound")) return is_bound;
|
else if (!strcmp(dest,"isbound")) return is_bound;
|
||||||
|
|
||||||
|
|
||||||
else if (dest[0]=='#') {
|
else if (dest[0]=='#') {
|
||||||
error(ERROR,"don't use quotes when peeking into a file");
|
error(ERROR,"don't use quotes when peeking into a file");
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1692,6 +1694,7 @@ static char *peek2(char *dest,struct command *curr) /* peek into internals */
|
|||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
|
|
||||||
for(s=dest;*s;s++) *s=tolower((int)*s);
|
for(s=dest;*s;s++) *s=tolower((int)*s);
|
||||||
if (!strcmp(dest,"infolevel")) {
|
if (!strcmp(dest,"infolevel")) {
|
||||||
if (infolevel==DEBUG) return my_strdup("debug");
|
if (infolevel==DEBUG) return my_strdup("debug");
|
||||||
|
|||||||
Reference in New Issue
Block a user