Hello
I wounder if someone can try to translate this VB code (from NMDC) to LUA
Function AfterLast(sIn,sLast)
AfterLast = Right(sIn,Len(sIn) - InstrRev(sIn,sLast,-1) - (Len(sLast) - 1))
End Function
Thanks to you who tries to translate it.
// Icanos
tinsert(TableName, DataToInsert)
plop
QuoteOriginally posted by plop
tinsert(TableName, DataToInsert)
plop
???
Function AfterLast(sIn,sLast)
AfterLast = Right(sIn,Len(sIn) - InstrRev(sIn,sLast,-1) - (Len(sLast) - 1))
End Function
function AfterFirst(control,data)
local s,e,first,data = strfind(data,control.."(%S+)")
return data
end;
function AfterLast(control,data)
local s,e,first,data = strfind(data,control.."(%S+)")
-- // now lets loop til the end
bool somevar = false;
while(somevar == false)
{
local tempvar = data;
local s,e,first = strfind(data,control)
if first then
local s,e,first,data = strfind(data,control.."(%S+)")
if data then
-- // hummm
else
data = tempvar;
somevar = true;
end;
end
}
return data
end;
oops soz lol need to practice liua bit again lol
function AfterLast(control,data)
local true = 1; local false = 2
local s,e,first,data = strfind(data,control.."(%S+)")
-- // now lets loop til the end
local somevar = false;
while (somevar == false) then
local tempvar = data;
local s,e,first = strfind(data,control)
if first then
local s,e,first,data = strfind(data,control.."(%S+)")
if data then
-- // hummm
else
data = tempvar;
somevar = true;
end;
end
end;
return data
end;
function AfterLast(sIn, sLast)
local _, _, ret = strfind(sIn, ".*".. sLast .. "(.-)$");
return ret;
end
You just have to be carefull that sLast is not a special regex character recognized by strfind.
See the lua manual for more information: http://www.lua.org/manual/4.0/manual.html#6.2
Phatty, %S will only capture non white space characters.
-NotRabidWombat
QuoteOriginally posted by NotRabidWombat
function AfterLast(sIn, sLast)
local _, _, ret = strfind(sIn, ".*".. sLast .. "(.-)$");
end
You just have to be carefull that sLast is not a special regex character recognized by strfind.
See the lua manual for more information: http://www.lua.org/manual/4.0/manual.html#6.2
Phatty, %S will only capture non white space characters.
-NotRabidWombat
humm i'll keep that in mind thanks, will av to come back tolua soon anyways ;-)
QuoteOriginally posted by (uk-kingdom)pH?tt?
QuoteOriginally posted by plop
tinsert(TableName, DataToInsert)
plop
???
makes it clear that i don't know vbs. lol
plop
Be glad. I felt dumber after using vbs.
-NotRabidWombat
Quotemakes it clear that i don't know vbs. lol
plop
you dont want to neither mate lol, to slow n c..p
QuoteOriginally posted by NotRabidWombat
Be glad. I felt dumber after using vbs.
-NotRabidWombat
eheh funny this is so did i :/ lol
i've planned 2 keep it like this.
plop
QuoteOriginally posted by plop
i've planned 2 keep it like this.
plop
hahh good, altho u shud try c/c++, very nice language c, i was also thinking about checking out delphi, but ive heard its unstable, light on memory and cpu, but unstable so i duno, and due to yhub being port bombed and yhub crashing comp, im guessing thats the unstableness lol
Thanks to you all! Love u :P