Author Topic: %include file name in variable  (Read 7308 times)

Offline akasei

  • Jr. Member
  • *
  • Posts: 8
%include file name in variable
« on: April 01, 2016, 07:10:36 AM »
Code: [Select]
%define VARIABLE_KERNEL_LOCALE "pl_PL"
%include "locale/", VARIABLE_KERNEL_LOCALE, ".asm"
How to do that?

Offline Bryant Keller

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 360
  • Country: us
    • About Bryant Keller
Re: %include file name in variable
« Reply #1 on: April 03, 2016, 06:20:49 AM »
use %defstr and %strcat.
Code: [Select]
%push
    %defstr %$VAR_KERN_LOCALE pl_PL
    %strcat %$myinc, "locale/", %$VAR_KERN_LOCALE, ".asm"
    %include %$myinc
%pop

About Bryant Keller
bkeller@about.me

Offline akasei

  • Jr. Member
  • *
  • Posts: 8
Re: %include file name in variable
« Reply #2 on: April 04, 2016, 09:11:51 AM »
Thank You very much!

config.asm
Code: [Select]
%define VARIABLE_KERNEL_LOCALE en_US.ASCII
kernel.asm
Code: [Select]
%include "config.asm"

%push
%defstr %$kernel_locale VARIABLE_KERNEL_LOCALE
%strcat %$include_kernel_locale, "locale/", %$kernel_locale, ".asm"
%$include %$include_kernel_locale
%pop