Check-in [e792c15f02]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[COMPONENTS.BAS] - Implement a little system to include and run site components.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e792c15f0268e54edefa27f29c186b79f78b3ddc
User & Date: Administrador 2016-10-06 03:25:55
Context
2016-10-06
03:30
[DATA] - Move the data folder outside the root directory. check-in: 4a18741bf8 user: Administrador tags: trunk
03:25
[COMPONENTS.BAS] - Implement a little system to include and run site components. check-in: e792c15f02 user: Administrador tags: trunk
03:03
[MAIN] - Include http.bas in the main application file. check-in: c83533382c user: Administrador tags: trunk
Changes

Added root/core/components.bas.







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'############################### Components.bas ################################
'This is a little system to include and run site components.

COMMON SHARED compiledComponents$()
DIM arrayIndex

'Now we have to include files, one for each component.

FUNCTION loadComponent$(comName$, comCmd$)
  SELECT CASE comName$
    CASE ELSE
      loadComponent$ = ""
  END SELECT
END FUNCTION

FUNCTION componentParser$(strCmd$)
  DIM componentName$, subCommand$, result$, i
  IF INSTR(strCmd$, CHR$(95)) > 0 THEN
    componentName$ = MID$(strCmd$, 1, INSTR(strCmd$, CHR$(95)) - 1)
    subCommand$ = MID$(strCmd$, INSTR(strCmd$, CHR$(95)) + 1, LEN(strCmd$))
  ELSE
    componentName$ = strCmd$
    subCommand$ = ""
  END IF
  FOR i = 0 TO UBOUND(compiledComponents$)
    IF componentName$ = compiledComponents$(i) THEN
      result$ = loadComponent$(componentName$, subCommand$)
      EXIT FOR
    ELSE
      result$ = componentName$
    END IF
  NEXT
  componentParser$ = result$
  result$ = ""
END FUNCTION