[TGR] Dexter TG Captain
Posts : 484 Reputation : 11 Join date : 2010-01-01
| Subject: COME ON CODERS! Wed Feb 03, 2010 8:37 pm | |
| Get this section more lively you lazy bunch! | |
|
tatoma4
Posts : 208 Reputation : 9 Join date : 2009-09-23 Age : 29 Location : Finland
| Subject: Re: COME ON CODERS! Wed Feb 03, 2010 9:22 pm | |
| Wait, im doing my c# program that is also my school assingment. I will post it in 2 weeks, maybe. Its also presentation of myself. NOTE: Its written in finnish, but i will do quick translate into english. | |
|
Zemog TG Colonel
Posts : 2210 Reputation : 33 Join date : 2009-05-27 Age : 30
| Subject: Re: COME ON CODERS! Sun May 02, 2010 11:53 am | |
| I know C++ and Lua, but only in Spanish. - Code:
-
argumentos a partir de los resultados. Si la función no tiene resultados, el `> 'es opcional.
# Incluir <stdarg.h> call_va Vacío (* const char Función, sig const char *, ...) ( va_list vl; narg int, nres; / * Número de Argumentos Y RESULTADOS * / va_start (vl, sig); lua_getglobal (L, func); / * * Función obtener la / / Push Argumentos * * / narg = 0; while () * SIG (/ Empuje * Argumentos * / switch (* sig + +) ( case 'd': / * Argumento de doble / lua_pushnumber (L, va_arg (vl, doble)); break; case 'i': / * int Argumento / lua_pushnumber (L, va_arg (vl, int)); break; case 's': / * Argumento de Cadena / lua_pushstring (L, va_arg (vl, char *)); break; Caso '>': goto finalwhile; Por defecto: error (L "Opcion no valida (% c)", * (sig - 1)); ) narg + +; luaL_checkstack (L, 1, "demasiados Argumentos"); Endwhile): / * * Hacer la Llamada / nres = strlen (sig); / * Número de * RESULTADOS esperados / if (lua_pcall (L, narg, nres, 0)! = 0) / * * Hacer la Llamada / error (L-Función de error ejecutando `% s ':% s", func, lua_tostring (L, -1)); / * * Recuperar RESULTADOS / nres =- nres; / * Índice de pila * resultados por cebado / while () * SIG (/ * obtener RESULTADOS * / switch (* sig + +) ( case 'd': / * * resultados por doble / if (! lua_isnumber (L, nres)) error (L ", ESCRIBA resultados por mal de las Naciones Unidas"); * Va_arg (vl, double *) lua_tonumber = (L, nres); break; case 'i': / * los resultados por int / if (! lua_isnumber (L, nres)) error (L ", ESCRIBA resultados por mal de las Naciones Unidas"); * Va_arg (vl, int *) = (int) lua_tonumber (L, nres); break; case 's': / * Cadena resultados por / if (! lua_isstring (L, nres)) error (L ", ESCRIBA resultados por mal de las Naciones Unidas"); * Va_arg (vl, const char **) lua_tostring = (L, nres); break; Por defecto: error (L "Opcion no valida (% c)", * (sig - 1)); ) nres + +; ) va_final (vl); ) | |
|
[TG] Chief (alex) -Admin- TG Leader
Posts : 1525 Reputation : 59 Join date : 2009-05-17 Age : 31 Location : I am from norway, north norway!
| Subject: Re: COME ON CODERS! Sun May 02, 2010 4:23 pm | |
| I'm coding on goatengine as we speak! Hoping to get it finished in the summer vacation! | |
|
[TGR] Dexter TG Captain
Posts : 484 Reputation : 11 Join date : 2010-01-01
| Subject: Re: COME ON CODERS! Sun May 02, 2010 9:47 pm | |
| | |
|
Sponsored content
| Subject: Re: COME ON CODERS! | |
| |
|