Parents
  • the macro below is just for quick viewing specs
    not in specon mode
    change value in single quotes in first line to the path of the folder you want to use as folder for specs output
    then go to SPWL level and run macro
    it will collect all SPECS within SPWL and output it
    check folder then


    !outputFolder = '[COLOR=#FF0000]C:\temp\specs\[/COLOR]'

    !outputFolderOF = OBJECT FILE(!outputFolder)
    if (!outputFolderOF.Exists().Not()) then
     !!Alert.Message('Please first create folder
     $!outputFolder')
      RETURN
    endif
    if (!!CE.Type NEQ 'SPWL') then
     !!Alert.Message('Works only on SPWL level')
      RETURN
    endif

    !getCE = !!CE.Name
    VAR !specs COLLECT ALL SPEC WITH ( NOT ( MATCHW(NAME,'*LIMBO*') ) ) FOR CE
    do !x from 1 to !specs.Size()
    !outputArray = OBJECT ARRAY()
     !outputFileName = !outputFolder + !specs[!x].Dbref().Name.Replace('/','_') + '.csv'
     !outputFileNameOF = object file(!outputFileName)
     !outputArray.Append('Specification: ' + !specs[!x].Dbref().Name)
     var !GtypSele COLLECT ALL SPEC MEM WITH (TYPE EQ 'SELE') for $!specs[$!x]
       do !y from 1 to !GtypSele.Size()
          !outputArray.Append(!GtypSele[!y].Dbref().Tans)
          !GtypSeleDepth = !GtypSele[!y].Dbref().Dbdept
         
       VAR !spcos COLLECT ALL SPCO FOR $!GtypSele[$!y]
       
       !outputArray.Append('Spco Name;Catref;Detail;Matxt;Cmpref')
       
       do !z from 1 to !spcos.Size()
         
       !outputString = ''
      !getCatref = !spcos[!z].Dbref().Catref.Name
        HANDLE ANY
          !getCatref = 'No valid Catref or unset'
        ENDHANDLE
       
      !getDetail = !spcos[!z].Dbref().Detref.Name
        HANDLE ANY
          !getDetail = 'No valid Detref or unset'
        ENDHANDLE
       
      !getMatref = !spcos[!z].Dbref().Matxt.Name
        HANDLE ANY
          !getMatref = 'No valid Matref or unset'
        ENDHANDLE
       
      !getCmpref = !spcos[!z].Dbref().Cmpref.Name
        HANDLE ANY
          !getCmpref = 'No valid Cmpref or unset'
        ENDHANDLE
       
      !spcoDepth = !spcos[!z].Dbref().Dbdepth
      !GetDepthUntilGtyp = !spcoDepth - !GtypSeleDepth - 1
      !outputString = !outputString + !spcos[!z].Dbref().Name + ';' + !getCatref + ';' + !getDetail + ';' + !getMatref + ';' + !getCmpref
         !outputArray.Append(!outputString)
       !outputString = ''
      !spcoOwnerQuestion = !spcos[!z].Dbref().Owner.Tquest
      !spcoAnswer = !spcos[!z].Dbref().Tanswer
      !spcoMaxAnswer = ''
        if (!spcoOwnerQuestion EQ '') then
          !spcoOwnerQuestion = !spcos[!z].Dbref().Owner.Quest
        endif
        if (!spcoAnswer EQ '') then
                   !spcoAnswer = !spcos[!z].Dbref().Answer.String()
       !spcoMaxAnswer = '(MaxAns=' + !spcos[!z].Dbref().MaxAnswer.String() + ')'
        endif    
       
       if (!spcoOwnerQuestion EQ 'PBOR') then
         !spcoOwnerQuestion = !spcoOwnerQuestion + !spcos[!z].Dbref().Owner.Qual.String()
       endif
       
           !outputString = !outputString + !spcoOwnerQuestion + '=' + !spcoAnswer + !spcoMaxAnswer
        $!spcos[$!z]
      do !a from 1 to !getDepthUntilGtyp
        OWNER
       
      !seleOwnerQuestion = !!CE.Owner.Tquest
      !seleAnswer = !!CE.Tanswer
      !seleMaxAnswer = ''  
        if (!seleOwnerQuestion EQ '') then
          !seleOwnerQuestion = !!CE.Owner.Quest
        endif
        if (!seleAnswer EQ '') then
                   !seleAnswer = !!CE.Answer.String()
       !seleMaxAnswer = '(MaxAns=' + !!CE.MaxAnswer.String() + ')'
        endif
       
       if (!seleOwnerQuestion EQ 'PBOR') then
         !seleOwnerQuestion = !seleOwnerQuestion + !!CE.Owner.Qual.String()
       endif
       
      !outputString = !outputString + '<--' + !seleOwnerQuestion + '=' + !seleAnswer + !seleMaxAnswer
      enddo  
         !outputArray.Append(!outputString)
            !outputArray.Append('')
       enddo
       
       !outputArray.Append('')
     
       enddo
       !outputArray.Append('')

    !outputFileNameOF.WriteFile('OVERWRITE',!outputArray)
    enddo

    $!getCE

    or simply use reports as it was said before
    for the Specon mode viewing it is much better to use me_hungry's macro with simple replacing
Reply
  • the macro below is just for quick viewing specs
    not in specon mode
    change value in single quotes in first line to the path of the folder you want to use as folder for specs output
    then go to SPWL level and run macro
    it will collect all SPECS within SPWL and output it
    check folder then


    !outputFolder = '[COLOR=#FF0000]C:\temp\specs\[/COLOR]'

    !outputFolderOF = OBJECT FILE(!outputFolder)
    if (!outputFolderOF.Exists().Not()) then
     !!Alert.Message('Please first create folder
     $!outputFolder')
      RETURN
    endif
    if (!!CE.Type NEQ 'SPWL') then
     !!Alert.Message('Works only on SPWL level')
      RETURN
    endif

    !getCE = !!CE.Name
    VAR !specs COLLECT ALL SPEC WITH ( NOT ( MATCHW(NAME,'*LIMBO*') ) ) FOR CE
    do !x from 1 to !specs.Size()
    !outputArray = OBJECT ARRAY()
     !outputFileName = !outputFolder + !specs[!x].Dbref().Name.Replace('/','_') + '.csv'
     !outputFileNameOF = object file(!outputFileName)
     !outputArray.Append('Specification: ' + !specs[!x].Dbref().Name)
     var !GtypSele COLLECT ALL SPEC MEM WITH (TYPE EQ 'SELE') for $!specs[$!x]
       do !y from 1 to !GtypSele.Size()
          !outputArray.Append(!GtypSele[!y].Dbref().Tans)
          !GtypSeleDepth = !GtypSele[!y].Dbref().Dbdept
         
       VAR !spcos COLLECT ALL SPCO FOR $!GtypSele[$!y]
       
       !outputArray.Append('Spco Name;Catref;Detail;Matxt;Cmpref')
       
       do !z from 1 to !spcos.Size()
         
       !outputString = ''
      !getCatref = !spcos[!z].Dbref().Catref.Name
        HANDLE ANY
          !getCatref = 'No valid Catref or unset'
        ENDHANDLE
       
      !getDetail = !spcos[!z].Dbref().Detref.Name
        HANDLE ANY
          !getDetail = 'No valid Detref or unset'
        ENDHANDLE
       
      !getMatref = !spcos[!z].Dbref().Matxt.Name
        HANDLE ANY
          !getMatref = 'No valid Matref or unset'
        ENDHANDLE
       
      !getCmpref = !spcos[!z].Dbref().Cmpref.Name
        HANDLE ANY
          !getCmpref = 'No valid Cmpref or unset'
        ENDHANDLE
       
      !spcoDepth = !spcos[!z].Dbref().Dbdepth
      !GetDepthUntilGtyp = !spcoDepth - !GtypSeleDepth - 1
      !outputString = !outputString + !spcos[!z].Dbref().Name + ';' + !getCatref + ';' + !getDetail + ';' + !getMatref + ';' + !getCmpref
         !outputArray.Append(!outputString)
       !outputString = ''
      !spcoOwnerQuestion = !spcos[!z].Dbref().Owner.Tquest
      !spcoAnswer = !spcos[!z].Dbref().Tanswer
      !spcoMaxAnswer = ''
        if (!spcoOwnerQuestion EQ '') then
          !spcoOwnerQuestion = !spcos[!z].Dbref().Owner.Quest
        endif
        if (!spcoAnswer EQ '') then
                   !spcoAnswer = !spcos[!z].Dbref().Answer.String()
       !spcoMaxAnswer = '(MaxAns=' + !spcos[!z].Dbref().MaxAnswer.String() + ')'
        endif    
       
       if (!spcoOwnerQuestion EQ 'PBOR') then
         !spcoOwnerQuestion = !spcoOwnerQuestion + !spcos[!z].Dbref().Owner.Qual.String()
       endif
       
           !outputString = !outputString + !spcoOwnerQuestion + '=' + !spcoAnswer + !spcoMaxAnswer
        $!spcos[$!z]
      do !a from 1 to !getDepthUntilGtyp
        OWNER
       
      !seleOwnerQuestion = !!CE.Owner.Tquest
      !seleAnswer = !!CE.Tanswer
      !seleMaxAnswer = ''  
        if (!seleOwnerQuestion EQ '') then
          !seleOwnerQuestion = !!CE.Owner.Quest
        endif
        if (!seleAnswer EQ '') then
                   !seleAnswer = !!CE.Answer.String()
       !seleMaxAnswer = '(MaxAns=' + !!CE.MaxAnswer.String() + ')'
        endif
       
       if (!seleOwnerQuestion EQ 'PBOR') then
         !seleOwnerQuestion = !seleOwnerQuestion + !!CE.Owner.Qual.String()
       endif
       
      !outputString = !outputString + '<--' + !seleOwnerQuestion + '=' + !seleAnswer + !seleMaxAnswer
      enddo  
         !outputArray.Append(!outputString)
            !outputArray.Append('')
       enddo
       
       !outputArray.Append('')
     
       enddo
       !outputArray.Append('')

    !outputFileNameOF.WriteFile('OVERWRITE',!outputArray)
    enddo

    $!getCE

    or simply use reports as it was said before
    for the Specon mode viewing it is much better to use me_hungry's macro with simple replacing
Children
No Data