'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright by Weinmann Holzbausystemtechnik GmbH (c) 2005
'
' Filename:           MultiBalken.WMK
'
' Description:        Multi Balken
'
' Author:             Mikan
'
' Date:               20050512
'
' Version:            V0.01

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Author:             TB32HVR
' Date:               20060210
' Version:            V0.02
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

SUB MAIN

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
DIM sIni
DIM nBreite
DIM nHoehe
DIM nLaenge
DIM nCountBalken

const MACROTITLE = "Macro"

DIM nCountCycle
DIM nPosX
DIM nPosY
DIM nPosZ
DIM nIndex

'Holen Parameterbezeichnungen abhaengig von der Landessprache
sIni = "l" + GETACTUALLANGUAGE() + ".ini"
nIndex = 0 ' constant ?

' default values
nBreite = 85
nHoehe = 38
nLaenge = 1000
nCountBalken = 1

' ==========================================================================

nCountCycle = 0

DIM sCount
sCount = GETPRIVATEPROFILESTRING("GENERAL", "P0", " ", sIni)

IF NOT GetDimension("P2:", nBreite, nCountCycle, sIni) THEN EXIT SUB
IF NOT GetDimension("P3:", nHoehe, nCountCycle, sIni) THEN EXIT SUB
nPosX = 0
nPosY = 0
DO
  nCountCycle = nCountCycle + 1
  IF NOT GetDimension("P1:", nLaenge, nCountCycle, sIni) THEN EXIT DO
  IF NOT GetDimension(sCount, nCountBalken, nCountCycle, sIni) THEN EXIT DO

  nCountBalken = INT(nCountBalken)

  FOR nPosZ = 0 TO ((nCountBalken-1)*nHoehe) STEP nHoehe
      'LS nLaenge, nBreite, nHoehe, nPosX, nPosY, nIndex, "LS_" & nPosY & "_" & nPosZ, nPosZ
      LS nLaenge, nBreite, nHoehe, nPosX, nPosY, nIndex, "LS", nPosZ
  NEXT
  nPosY = nPosY+nBreite+50
LOOP

END SUB
' ==========================================================================

FUNCTION GetDimension(sPrompt, DimVal, Count, sIni)

const MACROTITLE = "Macro"

DO
  DimVal = InputBoxFLoc( sPrompt, MACROTITLE, DimVal )

  IF bInputBoxCancel = 1 THEN
     GetDimension = False
     EXIT DO
  END IF

  IF (DimVal = 0) AND (Count > 0) THEN
    GetDimension = false
    EXIT DO
  ELSEIF (DimVal > 0) THEN
    GetDimension = true
    EXIT DO
  ELSE
  MsgBox GETPRIVATEPROFILESTRING("Fehler", "F6", " ", sIni), vbOkOnly + vbCritical + vbSystemModal,"Error"
  END IF
LOOP
END FUNCTION

' ==========================================================================

MAIN
